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() |
|
51 | |||
52 | /** |
||
53 | * Give this manager the collections we'll be using for dynamic PageViews. |
||
54 | * |
||
55 | * @param ContentItem[][] $collections |
||
56 | * |
||
57 | * @since 0.1.0 |
||
58 | */ |
||
59 | 4 | public function setCollections(&$collections) |
|
63 | |||
64 | /** |
||
65 | * Get all of the PageViews tracked by this manager. |
||
66 | * |
||
67 | * @since 0.1.0 |
||
68 | * |
||
69 | * @return PageView[][] |
||
70 | */ |
||
71 | 5 | public function getAllPageViews() |
|
75 | |||
76 | /** |
||
77 | * Get the static PageViews tracked by this manager indexed by their title. |
||
78 | * |
||
79 | * @since 0.1.0 |
||
80 | * |
||
81 | * @return PageView[] |
||
82 | */ |
||
83 | 1 | public function getStaticPageViews() |
|
87 | |||
88 | /** |
||
89 | * Get the jailed version of the static PageViews indexed by their title. |
||
90 | * |
||
91 | * @since 0.1.0 |
||
92 | * |
||
93 | * @return JailObject[] |
||
94 | */ |
||
95 | 1 | public function getJailedStaticPageViews() |
|
106 | |||
107 | /** |
||
108 | * Go through all of the PageView directories and create a respective PageView for each and classify them as a |
||
109 | * dynamic or static PageView. |
||
110 | * |
||
111 | * @param string[] $pageViewFolders |
||
112 | * |
||
113 | * @since 0.1.0 |
||
114 | */ |
||
115 | 7 | public function parsePageViews($pageViewFolders) |
|
138 | |||
139 | /** |
||
140 | * Add a new ContentItem to the respective parent PageView of the ContentItem. |
||
141 | * |
||
142 | * @param ContentItem $contentItem |
||
143 | * |
||
144 | * @since 0.1.0 |
||
145 | */ |
||
146 | 1 | public function trackNewContentItem(&$contentItem) |
|
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | 6 | protected function handleTrackableItem($filePath, $options = array()) |
|
178 | |||
179 | /** |
||
180 | * Handle special behavior and treatment for static PageViews while we're iterating through them. |
||
181 | * |
||
182 | * @param PageView $pageView |
||
183 | * |
||
184 | * @since 0.1.0 |
||
185 | */ |
||
186 | 2 | private function handleTrackableStaticPageView(&$pageView) |
|
195 | |||
196 | /** |
||
197 | * Handle special behavior and treatment for dynamic PageViews while we're iterating through them. |
||
198 | * |
||
199 | * @param DynamicPageView $pageView |
||
200 | * |
||
201 | * @since 0.1.0 |
||
202 | */ |
||
203 | 4 | private function handleTrackableDynamicPageView(&$pageView) |
|
219 | } |
||
220 |
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.