@@ -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; |
@@ -76,10 +76,10 @@ |
||
| 76 | 76 | |
| 77 | 77 | $finder = new Finder(); |
| 78 | 78 | $finder->files() |
| 79 | - ->name('/\.(html|twig)/') |
|
| 80 | - ->ignoreDotFiles(true) |
|
| 81 | - ->ignoreUnreadableDirs() |
|
| 82 | - ->in($pageViewFolder); |
|
| 79 | + ->name('/\.(html|twig)/') |
|
| 80 | + ->ignoreDotFiles(true) |
|
| 81 | + ->ignoreUnreadableDirs() |
|
| 82 | + ->in($pageViewFolder); |
|
| 83 | 83 | |
| 84 | 84 | foreach ($finder as $viewFile) |
| 85 | 85 | { |
@@ -58,7 +58,9 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function parsePageViews ($pageViewFolders) |
| 60 | 60 | { |
| 61 | - if (empty($pageViewFolders)) { return; } |
|
| 61 | + if (empty($pageViewFolders)) |
|
| 62 | + { |
|
| 63 | +return; } |
|
| 62 | 64 | |
| 63 | 65 | /** |
| 64 | 66 | * The name of the folder where PageViews are located |
@@ -109,7 +111,9 @@ discard block |
||
| 109 | 111 | */ |
| 110 | 112 | public function prepareDynamicPageViews ($collections) |
| 111 | 113 | { |
| 112 | - if (empty($collections)) { return; } |
|
| 114 | + if (empty($collections)) |
|
| 115 | + { |
|
| 116 | +return; } |
|
| 113 | 117 | |
| 114 | 118 | foreach ($this->dynamicPageViews as $pageView) |
| 115 | 119 | { |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | private $collections; |
| 14 | 14 | |
| 15 | - public function __construct() |
|
| 15 | + public function __construct () |
|
| 16 | 16 | { |
| 17 | 17 | parent::__construct(); |
| 18 | 18 | |
@@ -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(); |
@@ -112,9 +112,9 @@ |
||
| 112 | 112 | $dataItems = array(); |
| 113 | 113 | $finder = new Finder(); |
| 114 | 114 | $finder->files() |
| 115 | - ->ignoreDotFiles(true) |
|
| 116 | - ->ignoreUnreadableDirs() |
|
| 117 | - ->in($this->fs->absolutePath($folder)); |
|
| 115 | + ->ignoreDotFiles(true) |
|
| 116 | + ->ignoreUnreadableDirs() |
|
| 117 | + ->in($this->fs->absolutePath($folder)); |
|
| 118 | 118 | |
| 119 | 119 | foreach ($finder as $dataItem) |
| 120 | 120 | { |
@@ -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 |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $finder = new Finder(); |
| 68 | 68 | $finder->files() |
| 69 | - ->ignoreVCS(true) |
|
| 70 | - ->ignoreDotFiles(true) |
|
| 71 | - ->ignoreUnreadableDirs(); |
|
| 69 | + ->ignoreVCS(true) |
|
| 70 | + ->ignoreDotFiles(true) |
|
| 71 | + ->ignoreUnreadableDirs(); |
|
| 72 | 72 | |
| 73 | 73 | $finder->in( |
| 74 | 74 | empty(trim($searchIn)) ? getcwd() : $searchIn |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | public function removeExtension ($filename) |
| 156 | 156 | { |
| 157 | 157 | return $this->appendPath( |
| 158 | - $this->getFolderPath($filename), |
|
| 159 | - $this->getBaseName($filename) |
|
| 160 | - ); |
|
| 158 | + $this->getFolderPath($filename), |
|
| 159 | + $this->getBaseName($filename) |
|
| 160 | + ); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -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 | } |
@@ -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; |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | * @param string $configFile |
| 37 | 37 | * @param ConsoleInterface|OutputInterface|null $output |
| 38 | 38 | */ |
| 39 | - public function __construct($configFile, $output = null) |
|
| 39 | + public function __construct ($configFile, $output = null) |
|
| 40 | 40 | { |
| 41 | 41 | $this->configuration = array(); |
| 42 | 42 | $this->output = new ConsoleInterface($output); |
@@ -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 | } |
@@ -72,13 +72,13 @@ |
||
| 72 | 72 | $this->bodyContentEvaluated = true; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - return (string)$this->bodyContent; |
|
| 75 | + return (string) $this->bodyContent; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * @return PageView |
| 80 | 80 | */ |
| 81 | - public function &getPageView () |
|
| 81 | + public function &getPageView() |
|
| 82 | 82 | { |
| 83 | 83 | return $this->parentPageView; |
| 84 | 84 | } |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | /** |
| 175 | 175 | * Compile a single PageView into the appropriate output path |
| 176 | 176 | * |
| 177 | - * @param $filePath |
|
| 177 | + * @param string $filePath |
|
| 178 | 178 | * |
| 179 | 179 | * @return bool |
| 180 | 180 | */ |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * |
| 30 | 30 | * @return ContentItem|null |
| 31 | 31 | */ |
| 32 | - public function &getContentItem ($filePath) |
|
| 32 | + public function &getContentItem($filePath) |
|
| 33 | 33 | { |
| 34 | 34 | if ($this->isContentItem($filePath)) |
| 35 | 35 | { |
@@ -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)); |