@@ -18,7 +18,8 @@ |
||
| 18 | 18 | return $array; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - usort($array, function ($a, $b) use ($key, $order) { |
|
| 21 | + usort($array, function ($a, $b) use ($key, $order) |
|
| 22 | + { |
|
| 22 | 23 | $aValue = __::get($a, $key); |
| 23 | 24 | $bValue = __::get($b, $key); |
| 24 | 25 | |
@@ -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 | { |
@@ -158,6 +158,9 @@ |
||
| 158 | 158 | ); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | + /** |
|
| 162 | + * @return string |
|
| 163 | + */ |
|
| 161 | 164 | public static function stringToFormatter($format) |
| 162 | 165 | { |
| 163 | 166 | if ($format == 'nested') |
@@ -144,14 +144,17 @@ |
||
| 144 | 144 | { |
| 145 | 145 | $sourceMap = __::get($this->options, 'sourcemap'); |
| 146 | 146 | |
| 147 | - if ($sourceMap === 'inline') { |
|
| 147 | + if ($sourceMap === 'inline') |
|
| 148 | + { |
|
| 148 | 149 | $this->compiler->setSourceMap(Compiler::SOURCE_MAP_INLINE); |
| 149 | 150 | } |
| 150 | - elseif ($sourceMap === true) { |
|
| 151 | + elseif ($sourceMap === true) |
|
| 152 | + { |
|
| 151 | 153 | $this->compiler->setSourceMap(Compiler::SOURCE_MAP_FILE); |
| 152 | 154 | $this->fileSourceMap = true; |
| 153 | 155 | } |
| 154 | - else { |
|
| 156 | + else |
|
| 157 | + { |
|
| 155 | 158 | $this->compiler->setSourceMap(Compiler::SOURCE_MAP_NONE); |
| 156 | 159 | } |
| 157 | 160 | } |
@@ -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; |
@@ -88,9 +88,9 @@ |
||
| 88 | 88 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
| 89 | 89 | * |
| 90 | 90 | * @param DynamicPageView $pageView |
| 91 | - * @param $permalink |
|
| 91 | + * @param string $permalink |
|
| 92 | 92 | * |
| 93 | - * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
|
| 93 | + * @return CollectableItem|null |
|
| 94 | 94 | */ |
| 95 | 95 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
| 96 | 96 | { |
@@ -36,8 +36,10 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | private function staticPageViewController(StaticPageView $pageView, Compiler $compiler) |
| 38 | 38 | { |
| 39 | - return function () use ($pageView, $compiler) { |
|
| 40 | - if ($this->hasBeenTouched($pageView)) { |
|
| 39 | + return function () use ($pageView, $compiler) |
|
| 40 | + { |
|
| 41 | + if ($this->hasBeenTouched($pageView)) |
|
| 42 | + { |
|
| 41 | 43 | $pageView->readContent(); |
| 42 | 44 | } |
| 43 | 45 | |
@@ -61,7 +63,8 @@ discard block |
||
| 61 | 63 | */ |
| 62 | 64 | private function dynamicPageViewController(DynamicPageView $pageView, Compiler $compiler) |
| 63 | 65 | { |
| 64 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
| 66 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
| 67 | + { |
|
| 65 | 68 | $contentItem = self::getContentItem($pageView, $request->getUri()->getPath()); |
| 66 | 69 | |
| 67 | 70 | if ($contentItem === null) |
@@ -101,7 +104,8 @@ discard block |
||
| 101 | 104 | return $this->dynamicPageViewController($pageView, $compiler); |
| 102 | 105 | |
| 103 | 106 | default: |
| 104 | - return function () { |
|
| 107 | + return function () |
|
| 108 | + { |
|
| 105 | 109 | $errMsg = 'This URL type has not yet been implemented.'; |
| 106 | 110 | |
| 107 | 111 | return new Response(501, ['Content-Type' => 'text/plain'], $errMsg); |
@@ -139,7 +143,8 @@ discard block |
||
| 139 | 143 | */ |
| 140 | 144 | public static function create(PageViewRouter $router, Compiler $compiler) |
| 141 | 145 | { |
| 142 | - return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) { |
|
| 146 | + return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) |
|
| 147 | + { |
|
| 143 | 148 | $dispatcher = new RouteDispatcher(); |
| 144 | 149 | |
| 145 | 150 | foreach ($router->getRouteMapping() as $route => $pageView) |
@@ -13,6 +13,9 @@ |
||
| 13 | 13 | |
| 14 | 14 | class DevServer |
| 15 | 15 | { |
| 16 | + /** |
|
| 17 | + * @param string $url |
|
| 18 | + */ |
|
| 16 | 19 | private static function searchAsset($url, $continueNesting = true) |
| 17 | 20 | { |
| 18 | 21 | $preparedPath = substr($url, 0, 1) === '/' ? substr($url, 1) : $url; |
@@ -43,7 +43,8 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $dispatcher = RouteDispatcher::create($router, $compiler); |
| 45 | 45 | |
| 46 | - return new Server(function (ServerRequestInterface $request) use ($dispatcher) { |
|
| 46 | + return new Server(function (ServerRequestInterface $request) use ($dispatcher) |
|
| 47 | + { |
|
| 47 | 48 | $httpMethod = $request->getMethod(); |
| 48 | 49 | $urlPath = $request->getUri()->getPath(); |
| 49 | 50 | |