@@ -44,7 +44,7 @@ |
||
| 44 | 44 | /** |
| 45 | 45 | * Compile the website. |
| 46 | 46 | * |
| 47 | - * @return true if the website built successfully |
|
| 47 | + * @return false|null if the website built successfully |
|
| 48 | 48 | */ |
| 49 | 49 | public function build() |
| 50 | 50 | { |
@@ -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; |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | try |
| 72 | 72 | { |
| 73 | 73 | $highlighted = $this->highlighter->highlight($language, $block['element']['text']['text']); |
| 74 | - $block['markup'] = "<pre><code class=\"hljs ${cssClass}\">" . $highlighted->value . '</code></pre>'; |
|
| 74 | + $block['markup'] = "<pre><code class=\"hljs ${cssclass}\">" . $highlighted->value . '</code></pre>'; |
|
| 75 | 75 | |
| 76 | 76 | // Only return the block if Highlighter knew the language and how to handle it. |
| 77 | 77 | return $block; |
@@ -163,6 +163,9 @@ discard block |
||
| 163 | 163 | ); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | + /** |
|
| 167 | + * @param string $content |
|
| 168 | + */ |
|
| 166 | 169 | private function handleThemeImports(&$content) |
| 167 | 170 | { |
| 168 | 171 | if (($themeName = $this->configuration->getTheme())) |
@@ -172,6 +175,9 @@ discard block |
||
| 172 | 175 | } |
| 173 | 176 | } |
| 174 | 177 | |
| 178 | + /** |
|
| 179 | + * @return string |
|
| 180 | + */ |
|
| 175 | 181 | public static function stringToFormatter($format) |
| 176 | 182 | { |
| 177 | 183 | if ($format == 'nested') |
@@ -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 | |
@@ -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 | ]); |