1 | <?php |
||
44 | class Zamm implements SourceAccessorInterface |
||
45 | { |
||
46 | |||
47 | use Traits\SourceMagic; |
||
48 | |||
49 | /** |
||
50 | * @deprecated |
||
51 | * TODO See if it's used somewhere |
||
52 | */ |
||
53 | const Version = '1.0.0'; |
||
|
|||
54 | const MadeBy = 'Generated by Maslosoft Zamm'; |
||
55 | const DefaultInstanceId = 'zamm'; |
||
56 | |||
57 | /** |
||
58 | * Input for documentation |
||
59 | * Array of folders and files to process. |
||
60 | * @var string[] |
||
61 | */ |
||
62 | public $input = [ |
||
63 | 'docs' |
||
64 | ]; |
||
65 | |||
66 | public $output = [ |
||
67 | |||
68 | ]; |
||
69 | |||
70 | /** |
||
71 | * Configuration of decorators. |
||
72 | * This should be array with keys of renderer interface names and values of decorator classes. |
||
73 | * @var string[][] |
||
74 | */ |
||
75 | public $decorators = [ |
||
76 | // All around decorators |
||
77 | RendererInterface::class => [ |
||
78 | StarRemover::class |
||
79 | ], |
||
80 | // Class decorators |
||
81 | ClassRendererInterface::class => [ |
||
82 | ], |
||
83 | // Property decorators |
||
84 | PropertyRendererInterface::class => [ |
||
85 | ], |
||
86 | // Method decorators |
||
87 | MethodRendererInterface::class => [ |
||
88 | ], |
||
89 | ]; |
||
90 | |||
91 | /** |
||
92 | * Configuration of file decorators. |
||
93 | * This should be array with keys of converter names and values of file decorator classes. |
||
94 | * @var string[][] |
||
95 | */ |
||
96 | public $fileDecorators = [ |
||
97 | // All file decorators |
||
98 | FileDecoratorInterface::class => [ |
||
99 | MadeByFileDecorator::class |
||
100 | ], |
||
101 | // PHP converter decorators |
||
102 | PhpConverter::class => [ |
||
103 | IgnoreFileDecorator::class |
||
104 | ] |
||
105 | ]; |
||
106 | |||
107 | /** |
||
108 | * Converters |
||
109 | * Array of class names of converters. These will be applied in order specified here, to all files. |
||
110 | * All converters should implement `IConverter` interface. |
||
111 | * @see ConverterInterface |
||
112 | * @var string[] |
||
113 | */ |
||
114 | public $converters = [ |
||
115 | PhpConverter::class |
||
116 | ]; |
||
117 | |||
118 | /** |
||
119 | * Outputs classes |
||
120 | * Array of class names of outputs. These will be applied in order specified here, to all files. |
||
121 | * All outputs should implement `IOutput` interface. |
||
122 | * @see OutputInterface |
||
123 | * @var string[] |
||
124 | */ |
||
125 | public $outputs = [ |
||
126 | FileOutput::class |
||
127 | ]; |
||
128 | |||
129 | /** |
||
130 | * Extractor class name. |
||
131 | * This class will be used to extract source fragments. Defaults to `AddendumExtractor`. |
||
132 | * It implements `IExtractor` interface. |
||
133 | * @see AddendumExtractor |
||
134 | * @see ExtractorInterface |
||
135 | * @var string |
||
136 | */ |
||
137 | public $extractor = AddendumExtractor::class; |
||
138 | |||
139 | /** |
||
140 | * Extractor instance |
||
141 | * @var ExtractorInterface |
||
142 | */ |
||
143 | private $_extractor = null; |
||
144 | |||
145 | /** |
||
146 | * Working class name |
||
147 | * @var string|null |
||
148 | */ |
||
149 | private $_className = ''; |
||
150 | |||
151 | /** |
||
152 | * EmbeDi instance |
||
153 | * @var EmbeDi |
||
154 | */ |
||
155 | private $_di = null; |
||
156 | |||
157 | public function __construct($className = null) |
||
163 | |||
164 | public function init() |
||
168 | |||
169 | public function methods() |
||
175 | |||
176 | public function properties() |
||
182 | |||
183 | public function method($name) |
||
187 | |||
188 | public function property($name) |
||
192 | |||
193 | public function setExtractor(ExtractorInterface $extractor) |
||
197 | |||
198 | public function getExtractor() |
||
217 | |||
218 | public static function __callStatic($name, $arguments) |
||
223 | |||
224 | /** |
||
225 | * |
||
226 | * @return ClassRenderer |
||
227 | */ |
||
228 | public function __toString() |
||
232 | |||
233 | } |
||
234 |