1 | <?php |
||
32 | class PageManager extends TrackingManager |
||
33 | { |
||
34 | /** @var StaticPageView[] A place to store a reference to static PageViews with titles. */ |
||
35 | private $staticPages; |
||
36 | private $configuration; |
||
37 | private $collectionManager; |
||
38 | private $dataManager; |
||
39 | private $eventDispatcher; |
||
40 | private $logger; |
||
41 | |||
42 | /** |
||
43 | * PageManager constructor. |
||
44 | */ |
||
45 | 7 | public function __construct(Configuration $configuration, CollectionManager $collectionManager, DataManager $dataManager, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 7 | public function compileManager() |
|
67 | |||
68 | /** |
||
69 | * Go through all of the PageView directories and create a respective PageView for each and classify them by type. |
||
70 | * |
||
71 | * @param string[] $pageViewFolders |
||
72 | * |
||
73 | * @since 0.1.0 |
||
74 | * |
||
75 | * @throws \Exception When the EventDispatcher service couldn't be found. |
||
76 | */ |
||
77 | 7 | public function parsePageViews(array $pageViewFolders) |
|
94 | |||
95 | /** |
||
96 | * Get all of the PageViews in an associative array with PageView types as the keys. |
||
97 | * |
||
98 | * @since 0.1.1 |
||
99 | * |
||
100 | * @return BasePageView[][] |
||
101 | */ |
||
102 | public function &getPageViews() |
||
106 | |||
107 | /** |
||
108 | * Get all of the PageViews in flat array. |
||
109 | * |
||
110 | * @since 0.1.1 |
||
111 | * |
||
112 | * @return BasePageView[] |
||
113 | */ |
||
114 | 5 | public function &getPageViewsFlattened() |
|
118 | |||
119 | /** |
||
120 | * Get the static PageViews tracked by this manager indexed by their title. |
||
121 | * |
||
122 | * @since 0.1.0 |
||
123 | * |
||
124 | * @return StaticPageView[] |
||
125 | */ |
||
126 | 1 | public function getStaticPageViews() |
|
130 | |||
131 | /** |
||
132 | * Get the jailed version of the static PageViews indexed by their title. |
||
133 | * |
||
134 | * @since 0.1.0 |
||
135 | * |
||
136 | * @return JailedDocument[] |
||
137 | */ |
||
138 | 1 | public function getJailedStaticPageViews() |
|
149 | |||
150 | /** |
||
151 | * Add a new ContentItem to the respective parent PageView of the ContentItem. |
||
152 | * |
||
153 | * @param ContentItem $contentItem |
||
154 | * |
||
155 | * @since 0.1.0 |
||
156 | */ |
||
157 | 1 | public function trackNewContentItem(&$contentItem) |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | 6 | protected function &handleTrackableItem(File $filePath, array $options = array()) |
|
195 | |||
196 | /** |
||
197 | * Handle special behavior and treatment for static PageViews while we're iterating through them. |
||
198 | * |
||
199 | * @param StaticPageView $pageView |
||
200 | * |
||
201 | * @since 0.1.0 |
||
202 | */ |
||
203 | 2 | private function handleTrackableStaticPageView(&$pageView) |
|
216 | |||
217 | /** |
||
218 | * Handle special behavior and treatment for dynamic PageViews while we're iterating through them. |
||
219 | * |
||
220 | * @param DynamicPageView $pageView |
||
221 | * |
||
222 | * @since 0.1.0 |
||
223 | * |
||
224 | * @throws \Exception |
||
225 | */ |
||
226 | 4 | private function handleTrackableDynamicPageView(&$pageView) |
|
267 | |||
268 | /** |
||
269 | * Handle special behavior and treatment for repeater PageViews while we're iterating through them. |
||
270 | * |
||
271 | * @param RepeaterPageView $pageView |
||
272 | * |
||
273 | * @since 0.2.0 |
||
274 | */ |
||
275 | private function handleTrackableRepeaterPageView(&$pageView) |
||
282 | } |
||
283 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.