File tree Expand file tree Collapse file tree 1 file changed +70
-0
lines changed
Expand file tree Collapse file tree 1 file changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @link http://www.yiiframework.com/
4+ * @copyright Copyright (c) 2008 Yii Software LLC
5+ * @license http://www.yiiframework.com/license/
6+ */
7+
8+ namespace yii \apidoc \templates \json ;
9+
10+ use yii \apidoc \models \Context ;
11+ use yii \apidoc \renderers \ApiRenderer as BaseApiRenderer ;
12+ use yii \base \ViewContextInterface ;
13+ use Yii ;
14+
15+ /**
16+ * The class for outputting documentation data structures as a JSON text.
17+ *
18+ * @author Tom Worster <[email protected] > 19+ * @since 2.0.5
20+ */
21+ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
22+ {
23+
24+ /**
25+ * Writes a given [[Context]] as JSON text to file 'types.json'.
26+ *
27+ * @param Context $context the api documentation context to render.
28+ * @param $targetDir
29+ */
30+ public function render ($ context , $ targetDir )
31+ {
32+ $ types = array_merge ($ context ->classes , $ context ->interfaces , $ context ->traits );
33+ file_put_contents ($ targetDir . '/types.json ' , json_encode ($ types , JSON_PRETTY_PRINT ));
34+ }
35+
36+ /**
37+ * @inheritdoc
38+ */
39+ public function generateApiUrl ($ typeName )
40+ {
41+ }
42+
43+ /**
44+ * @inheritdoc
45+ */
46+ protected function generateFileName ($ typeName )
47+ {
48+ }
49+
50+ /**
51+ * @inheritdoc
52+ */
53+ public function getViewPath ()
54+ {
55+ }
56+
57+ /**
58+ * @inheritdoc
59+ */
60+ protected function generateLink ($ text , $ href , $ options = [])
61+ {
62+ }
63+
64+ /**
65+ * @inheritdoc
66+ */
67+ public function getSourceUrl ($ type , $ line = null )
68+ {
69+ }
70+ }
You can’t perform that action at this time.
0 commit comments