1 | <?php |
||
22 | class CollectionManager extends TrackingManager |
||
23 | { |
||
24 | /** @var string[][] A copy of the collection definitions to be available for later usage. */ |
||
25 | private $collectionDefinitions; |
||
26 | private $configuration; |
||
27 | private $eventDispatcher; |
||
28 | private $logger; |
||
29 | |||
30 | /** |
||
31 | * CollectionManager constructor. |
||
32 | */ |
||
33 | 36 | public function __construct(Configuration $configuration, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 6 | public function compileManager() |
|
53 | |||
54 | /** |
||
55 | * Get all of the ContentItems grouped by Collection name. |
||
56 | * |
||
57 | * ```php |
||
58 | * [ |
||
59 | * 'collection name' => [ |
||
60 | * new ContentItem(), |
||
61 | * new ContentItem(), |
||
62 | * ] |
||
63 | * ] |
||
64 | * ``` |
||
65 | * |
||
66 | * @return ContentItem[][] |
||
67 | */ |
||
68 | 15 | public function &getCollections() |
|
72 | |||
73 | /** |
||
74 | * Get a ContentItem from a Collection passed on it's path. |
||
75 | * |
||
76 | * @param string $filePath |
||
77 | * |
||
78 | * @throws TrackedItemNotFoundException |
||
79 | * |
||
80 | * @return ContentItem |
||
81 | */ |
||
82 | 1 | public function &getContentItem($filePath) |
|
91 | |||
92 | /** |
||
93 | * A jailed representation of CollectionManager::getCollections(). |
||
94 | * |
||
95 | * @return JailedDocument[][] |
||
|
|||
96 | */ |
||
97 | 19 | public function getJailedCollections() |
|
101 | |||
102 | /** |
||
103 | * Parse every collection and store them in the manager. |
||
104 | * |
||
105 | * @param string[][] $collections An array of definitions for collections |
||
106 | */ |
||
107 | 36 | public function parseCollections($collections) |
|
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | 1 | public function createNewItem($filePath) |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function refreshItem($filePath) |
||
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | 36 | protected function handleTrackableItem(File $filePath, array $options = []) |
|
192 | |||
193 | /** |
||
194 | * Get the name of the Collection this ContentItem belongs to based on its location. |
||
195 | * |
||
196 | * @param File $file |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | 1 | private function getCollectionNameFromPath(File $file) |
|
212 | } |
||
213 |
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.