1 | <?php |
||
28 | class CollectionManager extends TrackingManager |
||
29 | { |
||
30 | /** @var string[][] A copy of the collection definitions to be available for later usage. */ |
||
31 | private $collectionDefinitions; |
||
32 | /** @var MarkupEngineManager */ |
||
33 | private $markupEngineManager; |
||
34 | /** @var Configuration */ |
||
35 | private $configuration; |
||
36 | /** @var EventDispatcherInterface */ |
||
37 | private $eventDispatcher; |
||
38 | /** @var TemplateBridgeInterface */ |
||
39 | private $templateBridge; |
||
40 | /** @var LoggerInterface */ |
||
41 | private $logger; |
||
42 | |||
43 | /** |
||
44 | * CollectionManager constructor. |
||
45 | */ |
||
46 | 36 | public function __construct( |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 6 | public function compileManager() |
|
74 | |||
75 | /** |
||
76 | * Get all of the ContentItems grouped by Collection name. |
||
77 | * |
||
78 | * ```php |
||
79 | * [ |
||
80 | * 'collection name' => [ |
||
81 | * new ContentItem(), |
||
82 | * new ContentItem(), |
||
83 | * ] |
||
84 | * ] |
||
85 | * ``` |
||
86 | * |
||
87 | * @return ContentItem[][] |
||
88 | */ |
||
89 | 15 | public function &getCollections() |
|
93 | |||
94 | /** |
||
95 | * Get a ContentItem from a Collection passed on it's path. |
||
96 | * |
||
97 | * @param string $filePath |
||
98 | * |
||
99 | * @throws TrackedItemNotFoundException |
||
100 | * |
||
101 | * @return ContentItem |
||
102 | */ |
||
103 | 1 | public function &getContentItem($filePath) |
|
112 | |||
113 | /** |
||
114 | * A jailed representation of CollectionManager::getCollections(). |
||
115 | * |
||
116 | * @return JailedDocument[][] |
||
|
|||
117 | */ |
||
118 | public function getJailedCollections() |
||
124 | |||
125 | /** |
||
126 | * Parse every collection and store them in the manager. |
||
127 | * |
||
128 | * @param string[][] $collections An array of definitions for collections |
||
129 | */ |
||
130 | 36 | public function parseCollections($collections) |
|
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | 1 | public function createNewItem($filePath) |
|
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | public function refreshItem($filePath) |
||
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | 36 | protected function handleTrackableItem(File $filePath, array $options = []) |
|
220 | |||
221 | /** |
||
222 | * Get the name of the Collection this ContentItem belongs to based on its location. |
||
223 | * |
||
224 | * @param File $file |
||
225 | * |
||
226 | * @return string |
||
227 | */ |
||
228 | 1 | private function getCollectionNameFromPath(File $file) |
|
240 | } |
||
241 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.