@@ -14,6 +14,9 @@ |
||
14 | 14 | { |
15 | 15 | private $container; |
16 | 16 | |
17 | + /** |
|
18 | + * @return \Symfony\Component\DependencyInjection\ContainerInterface |
|
19 | + */ |
|
17 | 20 | public function getContainer() |
18 | 21 | { |
19 | 22 | if ($this->container === null) |
@@ -110,6 +110,9 @@ discard block |
||
110 | 110 | // Twig parent templates |
111 | 111 | /// |
112 | 112 | |
113 | + /** |
|
114 | + * @param string $filePath |
|
115 | + */ |
|
113 | 116 | public function isImportDependency($filePath) |
114 | 117 | { |
115 | 118 | return isset($this->importDependencies[$filePath]); |
@@ -162,6 +165,9 @@ discard block |
||
162 | 165 | } |
163 | 166 | } |
164 | 167 | |
168 | + /** |
|
169 | + * @param string $filePath |
|
170 | + */ |
|
165 | 171 | public function compileImportDependencies($filePath) |
166 | 172 | { |
167 | 173 | foreach ($this->importDependencies[$filePath] as &$dependent) |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @since 0.1.1 |
197 | 197 | */ |
198 | - public function compilePageView(PageView &$pageView) |
|
198 | + public function compilePageView(PageView & $pageView) |
|
199 | 199 | { |
200 | 200 | $this->twig->addGlobal('__currentTemplate', $pageView->getAbsoluteFilePath()); |
201 | 201 | $this->output->debug('Compiling {type} PageView: {pageview}', array( |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @since 0.1.1 |
244 | 244 | */ |
245 | - private function compileStaticPageView(PageView &$pageView) |
|
245 | + private function compileStaticPageView(PageView & $pageView) |
|
246 | 246 | { |
247 | 247 | $targetFile = $pageView->getTargetFile(); |
248 | 248 | $output = $this->renderStaticPageView($pageView); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * |
259 | 259 | * @since 0.1.1 |
260 | 260 | */ |
261 | - private function compileDynamicPageViews(DynamicPageView &$pageView) |
|
261 | + private function compileDynamicPageViews(DynamicPageView & $pageView) |
|
262 | 262 | { |
263 | 263 | $contentItems = $pageView->getRepeatableItems(); |
264 | 264 | $template = $this->createTwigTemplate($pageView); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * |
292 | 292 | * @since 0.1.1 |
293 | 293 | */ |
294 | - private function compileRepeaterPageViews(RepeaterPageView &$pageView) |
|
294 | + private function compileRepeaterPageViews(RepeaterPageView & $pageView) |
|
295 | 295 | { |
296 | 296 | $pageView->rewindPermalink(); |
297 | 297 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * |
317 | 317 | * @param ContentItem $contentItem |
318 | 318 | */ |
319 | - public function compileContentItem(ContentItem &$contentItem) |
|
319 | + public function compileContentItem(ContentItem & $contentItem) |
|
320 | 320 | { |
321 | 321 | $pageView = &$contentItem->getPageView(); |
322 | 322 | $template = $this->createTwigTemplate($pageView); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | * |
343 | 343 | * @since 0.1.1 |
344 | 344 | */ |
345 | - private function compileStandardRedirects(PermalinkDocument &$pageView) |
|
345 | + private function compileStandardRedirects(PermalinkDocument & $pageView) |
|
346 | 346 | { |
347 | 347 | $redirects = $pageView->getRedirects(); |
348 | 348 | |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * |
366 | 366 | * @since 0.1.1 |
367 | 367 | */ |
368 | - private function compileExpandedRedirects(RepeaterPageView &$pageView) |
|
368 | + private function compileExpandedRedirects(RepeaterPageView & $pageView) |
|
369 | 369 | { |
370 | 370 | $permalinks = $pageView->getRepeaterPermalinks(); |
371 | 371 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | * |
404 | 404 | * @return string |
405 | 405 | */ |
406 | - private function renderRepeaterPageView(Twig_Template &$template, RepeaterPageView &$pageView, ExpandedValue &$expandedValue) |
|
406 | + private function renderRepeaterPageView(Twig_Template & $template, RepeaterPageView & $pageView, ExpandedValue & $expandedValue) |
|
407 | 407 | { |
408 | 408 | $pageView->setFrontMatter(array( |
409 | 409 | 'permalink' => $expandedValue->getEvaluated(), |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * @since 0.1.1 |
427 | 427 | * |
428 | 428 | */ |
429 | - private function renderDynamicPageView(Twig_Template &$template, TwigDocument &$twigItem) |
|
429 | + private function renderDynamicPageView(Twig_Template & $template, TwigDocument & $twigItem) |
|
430 | 430 | { |
431 | 431 | return $template |
432 | 432 | ->render(array( |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * |
448 | 448 | * @return string |
449 | 449 | */ |
450 | - private function renderStaticPageView(PageView &$pageView) |
|
450 | + private function renderStaticPageView(PageView & $pageView) |
|
451 | 451 | { |
452 | 452 | return $this |
453 | 453 | ->createTwigTemplate($pageView) |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | * |
470 | 470 | * @return Twig_Template |
471 | 471 | */ |
472 | - private function createTwigTemplate(PageView &$pageView) |
|
472 | + private function createTwigTemplate(PageView & $pageView) |
|
473 | 473 | { |
474 | 474 | try |
475 | 475 | { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | protected $fs; |
22 | 22 | |
23 | 23 | /** |
24 | - * @param string $filePath |
|
24 | + * @param File $filePath |
|
25 | 25 | */ |
26 | 26 | public function __construct(File $filePath) |
27 | 27 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @deprecated Been replaced by getPageViewsFlattened() |
87 | 87 | * @since 0.1.0 |
88 | 88 | * |
89 | - * @return PageView[][] |
|
89 | + * @return \allejo\stakx\Document\TrackableDocument[] |
|
90 | 90 | */ |
91 | 91 | public function getAllPageViews() |
92 | 92 | { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @since 0.1.1 |
100 | 100 | * |
101 | - * @return PageView[][] |
|
101 | + * @return \allejo\stakx\Document\TrackableDocument[] |
|
102 | 102 | */ |
103 | 103 | public function &getPageViews() |
104 | 104 | { |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | - * @param File|string $filePath |
|
91 | + * @param string $filePath |
|
92 | 92 | * |
93 | - * @return mixed|null |
|
93 | + * @return PageView |
|
94 | 94 | */ |
95 | 95 | public function createNewItem($filePath) |
96 | 96 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * Update the contents of a specified file. |
137 | 137 | * |
138 | - * @param File|string $filePath The relative path of the file |
|
138 | + * @param string $filePath The relative path of the file |
|
139 | 139 | * |
140 | 140 | * @return PageView |
141 | 141 | */ |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | /** |
287 | 287 | * Return an array of JailedDocuments created from the tracked items |
288 | 288 | * |
289 | - * @param array $elements |
|
289 | + * @param TrackableDocument[] $elements |
|
290 | 290 | * |
291 | 291 | * @return JailedDocument[]|JailedDocument[][] |
292 | 292 | */ |
@@ -148,12 +148,12 @@ discard block |
||
148 | 148 | // Internal object handling |
149 | 149 | /// |
150 | 150 | |
151 | - protected function addFileToTracker(File &$file) |
|
151 | + protected function addFileToTracker(File & $file) |
|
152 | 152 | { |
153 | 153 | $this->trackedItemsFlattened[$file->getRelativeFilePath()] = &$file; |
154 | 154 | } |
155 | 155 | |
156 | - protected function delFileFromTracker(File &$file) |
|
156 | + protected function delFileFromTracker(File & $file) |
|
157 | 157 | { |
158 | 158 | unset($this->trackedItemsFlattened[$file->getRelativeFilePath()]); |
159 | 159 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @param TrackableDocument $trackedItem |
165 | 165 | * @param string|null $namespace |
166 | 166 | */ |
167 | - protected function addObjectToTracker(TrackableDocument &$trackedItem, $namespace = null) |
|
167 | + protected function addObjectToTracker(TrackableDocument & $trackedItem, $namespace = null) |
|
168 | 168 | { |
169 | 169 | if ($namespace == null) |
170 | 170 | { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @param TrackableDocument $trackedItem |
185 | 185 | * @param string|null $namespace |
186 | 186 | */ |
187 | - protected function delObjectFromTracker(TrackableDocument &$trackedItem, $namespace = null) |
|
187 | + protected function delObjectFromTracker(TrackableDocument & $trackedItem, $namespace = null) |
|
188 | 188 | { |
189 | 189 | if ($namespace == null) |
190 | 190 | { |
@@ -20,7 +20,8 @@ |
||
20 | 20 | */ |
21 | 21 | public static function array_safe_get(array $array, $key, $default = null) |
22 | 22 | { |
23 | - if (isset($array[$key])) { |
|
23 | + if (isset($array[$key])) |
|
24 | + { |
|
24 | 25 | return $array[$key]; |
25 | 26 | } |
26 | 27 |