1 | <?php |
||
25 | class PageManager extends TrackingManager |
||
26 | { |
||
27 | /** |
||
28 | * A reference to the collections available to this website. |
||
29 | * |
||
30 | * @var ContentItem[][] |
||
31 | */ |
||
32 | private $collections; |
||
33 | |||
34 | /** |
||
35 | * A place to store a reference to static PageViews with titles. |
||
36 | * |
||
37 | * @var PageView[] |
||
38 | */ |
||
39 | private $staticPages; |
||
40 | |||
41 | /** |
||
42 | * PageManager constructor. |
||
43 | */ |
||
44 | 7 | public function __construct() |
|
56 | |||
57 | /** |
||
58 | * Give this manager the collections we'll be using for dynamic PageViews. |
||
59 | * |
||
60 | * @param ContentItem[][] $collections |
||
61 | * |
||
62 | * @since 0.1.0 |
||
63 | */ |
||
64 | 4 | public function setCollections(&$collections) |
|
68 | |||
69 | /** |
||
70 | * Get all of the PageViews tracked by this manager. |
||
71 | * |
||
72 | * @since 0.1.0 |
||
73 | * |
||
74 | * @return PageView[][] |
||
75 | */ |
||
76 | 5 | public function getAllPageViews() |
|
80 | |||
81 | /** |
||
82 | * Get all of the PageViews in an associative array with PageView types as the keys |
||
83 | * |
||
84 | * @since 0.1.1 |
||
85 | * |
||
86 | * @return PageView[][] |
||
87 | */ |
||
88 | public function &getPageViews() |
||
92 | |||
93 | /** |
||
94 | * Get the static PageViews tracked by this manager indexed by their title. |
||
95 | * |
||
96 | * @since 0.1.0 |
||
97 | * |
||
98 | * @return PageView[] |
||
99 | */ |
||
100 | 1 | public function getStaticPageViews() |
|
104 | |||
105 | /** |
||
106 | * Get the jailed version of the static PageViews indexed by their title. |
||
107 | * |
||
108 | * @since 0.1.0 |
||
109 | * |
||
110 | * @return JailObject[] |
||
111 | */ |
||
112 | 7 | public function getJailedStaticPageViews() |
|
123 | |||
124 | /** |
||
125 | * Go through all of the PageView directories and create a respective PageView for each and classify them as a |
||
126 | * dynamic or static PageView. |
||
127 | * |
||
128 | * @param string[] $pageViewFolders |
||
129 | * |
||
130 | * @since 0.1.0 |
||
131 | */ |
||
132 | 7 | public function parsePageViews($pageViewFolders) |
|
155 | |||
156 | /** |
||
157 | * Add a new ContentItem to the respective parent PageView of the ContentItem. |
||
158 | * |
||
159 | * @param ContentItem $contentItem |
||
160 | * |
||
161 | * @since 0.1.0 |
||
162 | */ |
||
163 | 1 | public function trackNewContentItem(&$contentItem) |
|
168 | |||
169 | /** |
||
170 | * {@inheritdoc} |
||
171 | */ |
||
172 | 6 | protected function handleTrackableItem($filePath, $options = array()) |
|
195 | |||
196 | /** |
||
197 | * Handle special behavior and treatment for static PageViews while we're iterating through them. |
||
198 | * |
||
199 | * @param PageView $pageView |
||
200 | * |
||
201 | * @since 0.1.0 |
||
202 | */ |
||
203 | 2 | private function handleTrackableStaticPageView(&$pageView) |
|
212 | |||
213 | /** |
||
214 | * Handle special behavior and treatment for dynamic PageViews while we're iterating through them. |
||
215 | * |
||
216 | * @param DynamicPageView $pageView |
||
217 | * |
||
218 | * @since 0.1.0 |
||
219 | */ |
||
220 | 4 | private function handleTrackableDynamicPageView(&$pageView) |
|
236 | } |
||
237 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.