1 | <?php |
||
16 | class ContentParser |
||
17 | { |
||
18 | /** |
||
19 | * Markdown file iterator |
||
20 | * |
||
21 | * @var MarkdownFileIterator |
||
22 | */ |
||
23 | private $markdownFileIterator; |
||
24 | |||
25 | /** |
||
26 | * Content creator |
||
27 | * |
||
28 | * @var ContentCreator |
||
29 | */ |
||
30 | private $contentCreator; |
||
31 | |||
32 | /** |
||
33 | * Markdown document parser |
||
34 | * |
||
35 | * @var MarkdownDocumentParser |
||
36 | */ |
||
37 | private $markdownDocumentParser; |
||
38 | |||
39 | /** |
||
40 | * Markdown options |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | private $markdownOptions; |
||
45 | |||
46 | /** |
||
47 | * Content path |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $contentDir; |
||
52 | |||
53 | /** |
||
54 | * Constructor |
||
55 | * |
||
56 | * @param MarkdownFileIterator $markdownFileIterator |
||
57 | * @param ContentCreator $contentCreator |
||
58 | * @param MarkdownDocumentParser $markdownDocumentParser |
||
59 | */ |
||
60 | public function __construct(MarkdownFileIterator $markdownFileIterator, ContentCreator $contentCreator, |
||
69 | |||
70 | public function __invoke() |
||
102 | |||
103 | /** |
||
104 | * Get markdown file iterator |
||
105 | * |
||
106 | * @return MarkdownFileIterator |
||
107 | */ |
||
108 | public function getMarkdownFileIterator() : MarkdownFileIterator |
||
112 | |||
113 | /** |
||
114 | * Get content creator |
||
115 | * |
||
116 | * @return ContentCreator |
||
117 | */ |
||
118 | public function getContentCreator() : ContentCreator |
||
122 | |||
123 | /** |
||
124 | * Get markdown document parser |
||
125 | * |
||
126 | * @return MarkdownDocumentParser |
||
127 | */ |
||
128 | public function getMarkdownDocumentParser() : MarkdownDocumentParser |
||
132 | |||
133 | /** |
||
134 | * Get markdown option |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | public function getMarkdownOptions() : array |
||
142 | |||
143 | /** |
||
144 | * Get relative path |
||
145 | * |
||
146 | * @param \SplFileInfo $file |
||
147 | * @return string |
||
148 | */ |
||
149 | private function getRelativePath(\SplFileInfo $file) : string |
||
154 | } |