@@ -105,7 +105,8 @@ |
||
105 | 105 | */ |
106 | 106 | public function getJailedCollections() |
107 | 107 | { |
108 | - return self::getJailedTrackedItems($this->trackedItemsFlattened, function ($contentItem) { |
|
108 | + return self::getJailedTrackedItems($this->trackedItemsFlattened, function ($contentItem) |
|
109 | + { |
|
109 | 110 | return $contentItem['basename']; |
110 | 111 | }); |
111 | 112 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | /** |
41 | 41 | * Create the appropriate object type when parsing a PageView. |
42 | 42 | * |
43 | - * @return DynamicPageView|StaticPageView|RepeaterPageView |
|
43 | + * @return BasePageView |
|
44 | 44 | */ |
45 | 45 | public static function create(File $filePath, array $complexVariables = []) |
46 | 46 | { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
262 | - * @return Configuration|\PHPUnit_Framework_MockObject_MockObject |
|
262 | + * @return Configuration |
|
263 | 263 | */ |
264 | 264 | protected function getMockConfiguration() |
265 | 265 | { |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | /** |
378 | 378 | * Get a mock EventDispatcher. |
379 | 379 | * |
380 | - * @return EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject |
|
380 | + * @return EventDispatcherInterface |
|
381 | 381 | */ |
382 | 382 | protected function getMockEventDistpatcher() |
383 | 383 | { |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | /** |
388 | 388 | * Get a mock logger. |
389 | 389 | * |
390 | - * @return LoggerInterface|\PHPUnit_Framework_MockObject_MockObject |
|
390 | + * @return LoggerInterface |
|
391 | 391 | */ |
392 | 392 | protected function getMockLogger() |
393 | 393 | { |
@@ -27,6 +27,9 @@ |
||
27 | 27 | $this->generatorOptions = $options; |
28 | 28 | } |
29 | 29 | |
30 | + /** |
|
31 | + * @return string |
|
32 | + */ |
|
30 | 33 | public function getSourceMapContents() |
31 | 34 | { |
32 | 35 | return $this->sourceMapContent; |
@@ -13,11 +13,18 @@ discard block |
||
13 | 13 | protected static $runTimeStatus; |
14 | 14 | protected static $options; |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $key |
|
18 | + * @param string $value |
|
19 | + */ |
|
16 | 20 | public static function setOption($key, $value) |
17 | 21 | { |
18 | 22 | self::$options[$key] = $value; |
19 | 23 | } |
20 | 24 | |
25 | + /** |
|
26 | + * @param string $key |
|
27 | + */ |
|
21 | 28 | public static function getOption($key) |
22 | 29 | { |
23 | 30 | return isset(self::$options[$key]) ? self::$options[$key] : null; |
@@ -48,6 +55,9 @@ discard block |
||
48 | 55 | return self::$workingDirectory; |
49 | 56 | } |
50 | 57 | |
58 | + /** |
|
59 | + * @param \string|null $directory |
|
60 | + */ |
|
51 | 61 | public static function setWorkingDirectory($directory) |
52 | 62 | { |
53 | 63 | self::$workingDirectory = $directory; |
@@ -167,8 +167,8 @@ |
||
167 | 167 | { |
168 | 168 | if (($themeName = $this->configuration->getTheme())) |
169 | 169 | { |
170 | - $themePath = "../_themes/${themeName}/_sass"; |
|
171 | - $content = preg_replace("/(@import ['\"])(@theme)(.+)/", "$1${themePath}$3", $content); |
|
170 | + $themePath = "../_themes/${themename}/_sass"; |
|
171 | + $content = preg_replace("/(@import ['\"])(@theme)(.+)/", "$1${themepath}$3", $content); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 |
@@ -211,6 +211,9 @@ |
||
211 | 211 | $this->configureSourceMap(); |
212 | 212 | } |
213 | 213 | |
214 | + /** |
|
215 | + * @param string $content |
|
216 | + */ |
|
214 | 217 | private function handleThemeImports(&$content) |
215 | 218 | { |
216 | 219 | if (($themeName = $this->configuration->getTheme())) |
@@ -199,7 +199,7 @@ |
||
199 | 199 | if ($this->cacheDirectory) |
200 | 200 | { |
201 | 201 | $cacheOptions = [ |
202 | - 'cacheDir' => (string) $this->cacheDirectory->getFilesystemPath(), |
|
202 | + 'cacheDir' => (string)$this->cacheDirectory->getFilesystemPath(), |
|
203 | 203 | 'forceRefresh' => false, |
204 | 204 | ]; |
205 | 205 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * |
207 | 207 | * @param string $url |
208 | 208 | * |
209 | - * @return mixed |
|
209 | + * @return string |
|
210 | 210 | */ |
211 | 211 | public static function normalizeUrl($url) |
212 | 212 | { |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
218 | 218 | * |
219 | 219 | * @param DynamicPageView $pageView |
220 | - * @param $permalink |
|
220 | + * @param string $permalink |
|
221 | 221 | * |
222 | - * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
|
222 | + * @return CollectableItem|null |
|
223 | 223 | */ |
224 | 224 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
225 | 225 | { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | * Find the ExpandedValue from a Repeater PageView or null if it doesn't exist. |
241 | 241 | * |
242 | 242 | * @param RepeaterPageView $pageView |
243 | - * @param $permalink |
|
243 | + * @param string $permalink |
|
244 | 244 | * |
245 | 245 | * @return ExpandedValue|null |
246 | 246 | */ |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | */ |
46 | 46 | private function staticPageViewAction(StaticPageView $pageView, Compiler $compiler) |
47 | 47 | { |
48 | - return function () use ($pageView, $compiler) { |
|
48 | + return function () use ($pageView, $compiler) |
|
49 | + { |
|
49 | 50 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
50 | 51 | |
51 | 52 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -75,7 +76,8 @@ discard block |
||
75 | 76 | */ |
76 | 77 | private function dynamicPageViewAction(DynamicPageView $pageView, Compiler $compiler) |
77 | 78 | { |
78 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
79 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
80 | + { |
|
79 | 81 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
80 | 82 | |
81 | 83 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -111,7 +113,8 @@ discard block |
||
111 | 113 | */ |
112 | 114 | private function repeaterPageViewAction(RepeaterPageView $pageView, Compiler $compiler) |
113 | 115 | { |
114 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
116 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
117 | + { |
|
115 | 118 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
116 | 119 | |
117 | 120 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -154,7 +157,8 @@ discard block |
||
154 | 157 | return $this->repeaterPageViewAction($pageView, $compiler); |
155 | 158 | |
156 | 159 | default: |
157 | - return function () { |
|
160 | + return function () |
|
161 | + { |
|
158 | 162 | $errMsg = 'This URL type has not yet been implemented.'; |
159 | 163 | |
160 | 164 | return new Response(501, ['Content-Type' => 'text/plain'], $errMsg); |
@@ -171,7 +175,8 @@ discard block |
||
171 | 175 | */ |
172 | 176 | private function createRedirectAction($to) |
173 | 177 | { |
174 | - return function () use ($to) { |
|
178 | + return function () use ($to) |
|
179 | + { |
|
175 | 180 | return new Response(302, [ |
176 | 181 | 'Location' => $to, |
177 | 182 | ]); |
@@ -9,6 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | abstract class HtmlUtils |
11 | 11 | { |
12 | + /** |
|
13 | + * @param string $xpathQuery |
|
14 | + */ |
|
12 | 15 | public static function htmlXPath(\DOMDocument &$DOMDocument, $html, $xpathQuery) |
13 | 16 | { |
14 | 17 | $html = self::normalizeHTML($html); |
@@ -38,6 +41,9 @@ discard block |
||
38 | 41 | return $xpath->query($xpathQuery); |
39 | 42 | } |
40 | 43 | |
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
41 | 47 | private static function normalizeHTML($html) |
42 | 48 | { |
43 | 49 | if (strpos($html, '<body>') === false || strpos($html, '</body>') === false) |
@@ -783,6 +783,9 @@ |
||
783 | 783 | 'zmm' => 'application/vnd.handheld-entertainment+xml', |
784 | 784 | ]; |
785 | 785 | |
786 | + /** |
|
787 | + * @return \allejo\stakx\Document\StaticPageView |
|
788 | + */ |
|
786 | 789 | public static function getMimeType($extension) |
787 | 790 | { |
788 | 791 | return isset(self::$mimes[$extension]) ? self::$mimes[$extension] : null; |