@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Returns a list of filters. |
| 17 | 17 | * |
| 18 | - * @return array |
|
| 18 | + * @return Twig_SimpleFilter[] |
|
| 19 | 19 | */ |
| 20 | 20 | public function getFilters() |
| 21 | 21 | { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function getFilters () |
| 21 | 21 | { |
| 22 | 22 | return array( |
| 23 | - new Twig_SimpleFilter('summary', 'twig_summary_filter'), |
|
| 23 | + new Twig_SimpleFilter('summary', 'twig_summary_filter'), |
|
| 24 | 24 | new Twig_SimpleFilter('truncate', 'twig_truncate_filter', array('needs_environment' => true)), |
| 25 | 25 | new Twig_SimpleFilter('wordwrap', 'twig_wordwrap_filter', array('needs_environment' => true)), |
| 26 | 26 | ); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $length = $breakpoint; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - return rtrim(mb_substr($value, 0, $length, $env->getCharset())).$separator; |
|
| 76 | + return rtrim(mb_substr($value, 0, $length, $env->getCharset())) . $separator; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | return $value; |
@@ -64,7 +64,9 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function parseDataItems ($folders) |
| 66 | 66 | { |
| 67 | - if ($folders === null) { return; } |
|
| 67 | + if ($folders === null) |
|
| 68 | + { |
|
| 69 | +return; } |
|
| 68 | 70 | |
| 69 | 71 | foreach ($folders as $folder) |
| 70 | 72 | { |
@@ -84,7 +86,9 @@ discard block |
||
| 84 | 86 | */ |
| 85 | 87 | public function parseDataSets ($dataSets) |
| 86 | 88 | { |
| 87 | - if ($dataSets === null) { return; } |
|
| 89 | + if ($dataSets === null) |
|
| 90 | + { |
|
| 91 | +return; } |
|
| 88 | 92 | |
| 89 | 93 | /** |
| 90 | 94 | * The information which each DataSet has from the configuration file |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | /** |
| 33 | 33 | * Get all of the DataItems and DataSets in this manager |
| 34 | 34 | * |
| 35 | - * @return array |
|
| 35 | + * @return string |
|
| 36 | 36 | */ |
| 37 | 37 | public function getDataItems () |
| 38 | 38 | { |
@@ -25,7 +25,9 @@ |
||
| 25 | 25 | $highlighted = $this->highlighter->highlight($language, $block['element']['text']['text']); |
| 26 | 26 | $block['element']['text']['text'] = $highlighted->value; |
| 27 | 27 | } |
| 28 | - catch (\DomainException $exception) {} |
|
| 28 | + catch (\DomainException $exception) |
|
| 29 | + { |
|
| 30 | +} |
|
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | return $block; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | $this->highlighter = new Highlighter(); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - protected function blockHeader($line) |
|
| 16 | + protected function blockHeader ($line) |
|
| 17 | 17 | { |
| 18 | 18 | $Block = parent::blockHeader($line); |
| 19 | 19 | |
@@ -177,10 +177,13 @@ |
||
| 177 | 177 | break; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if (!is_null($pd)) // No parser needed |
|
| 180 | + if (!is_null($pd)) |
|
| 181 | + { |
|
| 182 | + // No parser needed |
|
| 181 | 183 | { |
| 182 | 184 | $this->bodyContent = $pd->parse($this->bodyContent); |
| 183 | 185 | } |
| 186 | + } |
|
| 184 | 187 | |
| 185 | 188 | $this->bodyContentEvaluated = true; |
| 186 | 189 | } |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | $this->bodyContentEvaluated = true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return (string)$this->bodyContent; |
|
| 87 | + return (string) $this->bodyContent; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * @return PageView |
| 92 | 92 | */ |
| 93 | - public function &getPageView () |
|
| 93 | + public function &getPageView() |
|
| 94 | 94 | { |
| 95 | 95 | return $this->parentPageView; |
| 96 | 96 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * {@inheritdoc} |
| 115 | 115 | */ |
| 116 | - public function jsonSerialize() |
|
| 116 | + public function jsonSerialize () |
|
| 117 | 117 | { |
| 118 | 118 | return array_merge($this->getFrontMatter(), array( |
| 119 | 119 | 'content' => $this->getContent() |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | * @throws FileNotFoundException When originFile doesn't exist |
| 63 | 63 | * @throws IOException When copy fails |
| 64 | 64 | */ |
| 65 | - public function copy($originFile, $targetFile, $overwriteNewerFiles = false) |
|
| 65 | + public function copy ($originFile, $targetFile, $overwriteNewerFiles = false) |
|
| 66 | 66 | { |
| 67 | 67 | if ($this->isDir($originFile)) |
| 68 | 68 | { |
@@ -76,7 +76,9 @@ |
||
| 76 | 76 | while (false !== $entry = $dir->read()) |
| 77 | 77 | { |
| 78 | 78 | // Skip pointers |
| 79 | - if ($entry == '.' || $entry == '..') { continue; } |
|
| 79 | + if ($entry == '.' || $entry == '..') |
|
| 80 | + { |
|
| 81 | +continue; } |
|
| 80 | 82 | |
| 81 | 83 | $this->copy("$originFile/$entry", "$targetFile/$entry", true); |
| 82 | 84 | } |
@@ -171,9 +171,9 @@ |
||
| 171 | 171 | public function removeExtension ($filename) |
| 172 | 172 | { |
| 173 | 173 | return $this->appendPath( |
| 174 | - $this->getFolderPath($filename), |
|
| 175 | - $this->getBaseName($filename) |
|
| 176 | - ); |
|
| 174 | + $this->getFolderPath($filename), |
|
| 175 | + $this->getBaseName($filename) |
|
| 176 | + ); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | if (!$this->fs->exists($filePath)) |
| 86 | 86 | { |
| 87 | - throw new FileNotFoundException("The following file could not be found: ${filePath}"); |
|
| 87 | + throw new FileNotFoundException("The following file could not be found: ${filepath}"); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $this->extension = strtolower($this->fs->getExtension($filePath)); |
@@ -392,7 +392,9 @@ |
||
| 392 | 392 | */ |
| 393 | 393 | final public function deleteFrontMatter ($key) |
| 394 | 394 | { |
| 395 | - if (!isset($this->writableFrontMatter[$key])) { return; } |
|
| 395 | + if (!isset($this->writableFrontMatter[$key])) |
|
| 396 | + { |
|
| 397 | +return; } |
|
| 396 | 398 | |
| 397 | 399 | unset($this->writableFrontMatter[$key]); |
| 398 | 400 | } |
@@ -318,7 +318,7 @@ |
||
| 318 | 318 | /** |
| 319 | 319 | * Get the original file path |
| 320 | 320 | * |
| 321 | - * @return string |
|
| 321 | + * @return SplFileInfo |
|
| 322 | 322 | */ |
| 323 | 323 | final public function getFilePath () |
| 324 | 324 | { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | if (!$this->fs->exists($this->themeFolder)) |
| 26 | 26 | { |
| 27 | - throw new FileNotFoundException("The '${themeName}' theme folder could not be found.'"); |
|
| 27 | + throw new FileNotFoundException("The '${themename}' theme folder could not be found.'"); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | if ($this->fs->exists($this->themeFile)) |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * {@inheritdoc} |
| 52 | 52 | */ |
| 53 | - public function refreshItem($filePath) |
|
| 53 | + public function refreshItem ($filePath) |
|
| 54 | 54 | { |
| 55 | 55 | $relativeFilePath = str_replace($this->themeFolderRelative . '/', '', $filePath); |
| 56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * {@inheritdoc} |
| 62 | 62 | */ |
| 63 | - public function isHandled($filePath) |
|
| 63 | + public function isHandled ($filePath) |
|
| 64 | 64 | { |
| 65 | 65 | $isThemeAsset = (substr($filePath, 0, strlen($this->themeFolderRelative)) === $this->themeFolderRelative); |
| 66 | 66 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * {@inheritdoc} |
| 72 | 72 | */ |
| 73 | - public function createNewItem($filePath) |
|
| 73 | + public function createNewItem ($filePath) |
|
| 74 | 74 | { |
| 75 | 75 | $relativeFilePath = str_replace($this->themeFolderRelative . '/', '', $filePath); |
| 76 | 76 | |
@@ -56,6 +56,9 @@ |
||
| 56 | 56 | $this->staticPageViews = array(); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param \allejo\stakx\Object\Configuration $configuration |
|
| 61 | + */ |
|
| 59 | 62 | public function configureTwig ($configuration, $options) |
| 60 | 63 | { |
| 61 | 64 | $twig = new TwigManager(); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | /** |
| 59 | 59 | * PageManager constructor |
| 60 | 60 | */ |
| 61 | - public function __construct() |
|
| 61 | + public function __construct () |
|
| 62 | 62 | { |
| 63 | 63 | parent::__construct(); |
| 64 | 64 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | /** |
| 229 | 229 | * {@inheritdoc} |
| 230 | 230 | */ |
| 231 | - public function isTracked($filePath) |
|
| 231 | + public function isTracked ($filePath) |
|
| 232 | 232 | { |
| 233 | 233 | return (parent::isTracked($filePath) || isset($this->twigExtendsDeps[$filePath])); |
| 234 | 234 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | /** |
| 237 | 237 | * {@inheritdoc} |
| 238 | 238 | */ |
| 239 | - public function refreshItem($filePath) |
|
| 239 | + public function refreshItem ($filePath) |
|
| 240 | 240 | { |
| 241 | 241 | if (parent::isTracked($filePath)) |
| 242 | 242 | { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * {@inheritdoc} |
| 258 | 258 | */ |
| 259 | - protected function handleTrackableItem($filePath, $options = array()) |
|
| 259 | + protected function handleTrackableItem ($filePath, $options = array()) |
|
| 260 | 260 | { |
| 261 | 261 | $pageView = PageView::create($filePath); |
| 262 | 262 | $namespace = $pageView->getType(); |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | { |
| 535 | 535 | $filePath = $this->fs->getRelativePath($parent->getSourceContext()->getPath()); |
| 536 | 536 | |
| 537 | - $this->twigExtendsDeps[$filePath][(string)$pageView->getFilePath()] = &$pageView; |
|
| 537 | + $this->twigExtendsDeps[$filePath][(string) $pageView->getFilePath()] = &$pageView; |
|
| 538 | 538 | $parent = $parent->getParent(array()); |
| 539 | 539 | } |
| 540 | 540 | } |
@@ -72,7 +72,9 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function setCollections (&$collections) |
| 74 | 74 | { |
| 75 | - if (empty($collections)) { return; } |
|
| 75 | + if (empty($collections)) |
|
| 76 | + { |
|
| 77 | +return; } |
|
| 76 | 78 | |
| 77 | 79 | $this->collections = &$collections; |
| 78 | 80 | } |
@@ -123,7 +125,8 @@ discard block |
||
| 123 | 125 | { |
| 124 | 126 | static $jailedMenu = array(); |
| 125 | 127 | |
| 126 | - if (!empty($jailedMenu)) { |
|
| 128 | + if (!empty($jailedMenu)) |
|
| 129 | + { |
|
| 127 | 130 | return $jailedMenu; |
| 128 | 131 | } |
| 129 | 132 | |
@@ -143,7 +146,9 @@ discard block |
||
| 143 | 146 | */ |
| 144 | 147 | public function parsePageViews ($pageViewFolders) |
| 145 | 148 | { |
| 146 | - if (empty($pageViewFolders)) { return; } |
|
| 149 | + if (empty($pageViewFolders)) |
|
| 150 | + { |
|
| 151 | +return; } |
|
| 147 | 152 | |
| 148 | 153 | /** |
| 149 | 154 | * The name of the folder where PageViews are located |
@@ -303,7 +308,8 @@ discard block |
||
| 303 | 308 | { |
| 304 | 309 | $this->addToSiteMenu($pageView); |
| 305 | 310 | |
| 306 | - if (!empty($pageView->title)) { |
|
| 311 | + if (!empty($pageView->title)) |
|
| 312 | + { |
|
| 307 | 313 | $this->flatPages[$pageView->title] = $pageView->createJail(); |
| 308 | 314 | } |
| 309 | 315 | } |
@@ -550,7 +556,9 @@ discard block |
||
| 550 | 556 | */ |
| 551 | 557 | private function trackParentTwigTemplate ($template, &$pageView) |
| 552 | 558 | { |
| 553 | - if (!$this->tracking) { return; } |
|
| 559 | + if (!$this->tracking) |
|
| 560 | + { |
|
| 561 | +return; } |
|
| 554 | 562 | |
| 555 | 563 | /** @var Twig_Template $parent */ |
| 556 | 564 | $parent = $template->getParent(array()); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | private static $twig; |
| 19 | 19 | |
| 20 | - public static function &getInstance () |
|
| 20 | + public static function &getInstance() |
|
| 21 | 21 | { |
| 22 | 22 | return self::$twig; |
| 23 | 23 | } |