@@ -203,7 +203,8 @@ |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if (strpos($haystack, $query, $offset) !== false) |
| 206 | - { // stop on first true result |
|
| 206 | + { |
|
| 207 | +// stop on first true result |
|
| 207 | 208 | return true; |
| 208 | 209 | } |
| 209 | 210 | } |
@@ -63,7 +63,8 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function getJailedDataItems() |
| 65 | 65 | { |
| 66 | - return self::getJailedTrackedItems($this->trackedItemsFlattened, function (DataItem $dataItem) { |
|
| 66 | + return self::getJailedTrackedItems($this->trackedItemsFlattened, function (DataItem $dataItem) |
|
| 67 | + { |
|
| 67 | 68 | return $dataItem->getBasename(); |
| 68 | 69 | }); |
| 69 | 70 | } |
@@ -55,14 +55,20 @@ |
||
| 55 | 55 | |
| 56 | 56 | $headingID = $heading->attributes->getNamedItem('id'); |
| 57 | 57 | |
| 58 | - if ($curr > $last) // If the current level is greater than the last level indent one level |
|
| 58 | + if ($curr > $last) |
|
| 59 | + { |
|
| 60 | + // If the current level is greater than the last level indent one level |
|
| 59 | 61 | { |
| 60 | 62 | $toc .= '<ul>'; |
| 61 | 63 | } |
| 62 | - elseif ($curr < $last) // If the current level is less than the last level go up appropriate amount. |
|
| 64 | + } |
|
| 65 | + elseif ($curr < $last) |
|
| 66 | + { |
|
| 67 | + // If the current level is less than the last level go up appropriate amount. |
|
| 63 | 68 | { |
| 64 | 69 | $toc .= str_repeat('</li></ul>', $last - $curr) . '</li>'; |
| 65 | 70 | } |
| 71 | + } |
|
| 66 | 72 | else // If the current level is equal to the last. |
| 67 | 73 | { |
| 68 | 74 | $toc .= '</li>'; |
@@ -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 | |
@@ -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 | } |
@@ -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 | } |
@@ -170,7 +170,8 @@ |
||
| 170 | 170 | return call_user_func_array([$this, $fxnCall], []); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - if (isset($this->data[$offset])) { |
|
| 173 | + if (isset($this->data[$offset])) |
|
| 174 | + { |
|
| 174 | 175 | return $this->data[$offset]; |
| 175 | 176 | } |
| 176 | 177 | |
@@ -43,7 +43,8 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $dispatcher = RouteDispatcher::create($router, $compiler); |
| 45 | 45 | |
| 46 | - return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher) { |
|
| 46 | + return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher) |
|
| 47 | + { |
|
| 47 | 48 | $httpMethod = $request->getMethod(); |
| 48 | 49 | $urlPath = RouteDispatcher::normalizeUrl($request->getUri()->getPath()); |
| 49 | 50 | |
@@ -38,10 +38,12 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | private function staticPageViewController(StaticPageView $pageView, Compiler $compiler) |
| 40 | 40 | { |
| 41 | - return function () use ($pageView, $compiler) { |
|
| 41 | + return function () use ($pageView, $compiler) |
|
| 42 | + { |
|
| 42 | 43 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
| 43 | 44 | |
| 44 | - if ($this->hasBeenTouched($pageView)) { |
|
| 45 | + if ($this->hasBeenTouched($pageView)) |
|
| 46 | + { |
|
| 45 | 47 | $pageView->readContent(); |
| 46 | 48 | } |
| 47 | 49 | |
@@ -65,7 +67,8 @@ discard block |
||
| 65 | 67 | */ |
| 66 | 68 | private function dynamicPageViewController(DynamicPageView $pageView, Compiler $compiler) |
| 67 | 69 | { |
| 68 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
| 70 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
| 71 | + { |
|
| 69 | 72 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
| 70 | 73 | |
| 71 | 74 | $contentItem = self::getContentItem($pageView, self::normalizeUrl($request->getUri()->getPath())); |
@@ -98,7 +101,8 @@ discard block |
||
| 98 | 101 | */ |
| 99 | 102 | private function repeaterPageViewController(RepeaterPageView $pageView, Compiler $compiler) |
| 100 | 103 | { |
| 101 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
| 104 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
| 105 | + { |
|
| 102 | 106 | $permalinks = $pageView->getRepeaterPermalinks(); |
| 103 | 107 | $url = self::normalizeUrl($request->getUri()->getPath()); |
| 104 | 108 | |
@@ -138,7 +142,8 @@ discard block |
||
| 138 | 142 | return $this->repeaterPageViewController($pageView, $compiler); |
| 139 | 143 | |
| 140 | 144 | default: |
| 141 | - return function () { |
|
| 145 | + return function () |
|
| 146 | + { |
|
| 142 | 147 | $errMsg = 'This URL type has not yet been implemented.'; |
| 143 | 148 | |
| 144 | 149 | return new Response(501, ['Content-Type' => 'text/plain'], $errMsg); |
@@ -178,7 +183,8 @@ discard block |
||
| 178 | 183 | { |
| 179 | 184 | self::$baseUrl = $router->getBaseUrl(); |
| 180 | 185 | |
| 181 | - return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) { |
|
| 186 | + return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) |
|
| 187 | + { |
|
| 182 | 188 | $dispatcher = new RouteDispatcher(); |
| 183 | 189 | |
| 184 | 190 | foreach ($router->getRouteMapping() as $route => $pageView) |