1 | <?php |
||
23 | class CollectionManager extends TrackingManager |
||
24 | { |
||
25 | /** @var string[][] A copy of the collection definitions to be available for later usage. */ |
||
26 | private $collectionDefinitions; |
||
27 | private $markupEngineManager; |
||
28 | private $configuration; |
||
29 | private $eventDispatcher; |
||
30 | private $logger; |
||
31 | |||
32 | /** |
||
33 | * CollectionManager constructor. |
||
34 | */ |
||
35 | public function __construct(MarkupEngineManager $markupEngineManager, Configuration $configuration, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function compileManager() |
||
56 | |||
57 | /** |
||
58 | * Get all of the ContentItems grouped by Collection name. |
||
59 | * |
||
60 | * ```php |
||
61 | * [ |
||
62 | * 'collection name' => [ |
||
63 | * new ContentItem(), |
||
64 | * new ContentItem(), |
||
65 | * ] |
||
66 | * ] |
||
67 | * ``` |
||
68 | * |
||
69 | * @return ContentItem[][] |
||
70 | */ |
||
71 | public function &getCollections() |
||
75 | |||
76 | /** |
||
77 | * Get a ContentItem from a Collection passed on it's path. |
||
78 | * |
||
79 | * @param string $filePath |
||
80 | * |
||
81 | * @throws TrackedItemNotFoundException |
||
82 | * |
||
83 | * @return ContentItem |
||
84 | */ |
||
85 | public function &getContentItem($filePath) |
||
94 | |||
95 | /** |
||
96 | * A jailed representation of CollectionManager::getCollections(). |
||
97 | * |
||
98 | * @return JailedDocument[][] |
||
|
|||
99 | */ |
||
100 | public function getJailedCollections() |
||
104 | |||
105 | /** |
||
106 | * Parse every collection and store them in the manager. |
||
107 | * |
||
108 | * @param string[][] $collections An array of definitions for collections |
||
109 | */ |
||
110 | public function parseCollections($collections) |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function createNewItem($filePath) |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function refreshItem($filePath) |
||
172 | |||
173 | /** |
||
174 | * {@inheritdoc} |
||
175 | */ |
||
176 | protected function handleTrackableItem(File $filePath, array $options = []) |
||
196 | |||
197 | /** |
||
198 | * Get the name of the Collection this ContentItem belongs to based on its location. |
||
199 | * |
||
200 | * @param File $file |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | private function getCollectionNameFromPath(File $file) |
||
216 | } |
||
217 |
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.