| @@ -197,7 +197,7 @@ | ||
| 197 | 197 | * | 
| 198 | 198 | * @param string $frontMatterKey The current hierarchy of the Front Matter keys being used | 
| 199 | 199 | * @param string $expandableValue The Front Matter value that will be expanded | 
| 200 | - * @param array $arrayVariableNames The Front Matter variable names that reference arrays | |
| 200 | + * @param string[] $arrayVariableNames The Front Matter variable names that reference arrays | |
| 201 | 201 | * | 
| 202 | 202 | * @throws YamlUnsupportedVariableException If a multidimensional array is given for value expansion | 
| 203 | 203 | * | 
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | * | 
| 62 | 62 | * @param array $rawFrontMatter | 
| 63 | 63 | */ | 
| 64 | - public function __construct(&$rawFrontMatter) | |
| 64 | + public function __construct (&$rawFrontMatter) | |
| 65 | 65 |      { | 
| 66 | 66 | $this->expansionUsed = false; | 
| 67 | 67 | $this->nestingLevel = 0; | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | * | 
| 79 | 79 | * @return bool | 
| 80 | 80 | */ | 
| 81 | - public function hasExpansion() | |
| 81 | + public function hasExpansion () | |
| 82 | 82 |      { | 
| 83 | 83 | return $this->expansionUsed; | 
| 84 | 84 | } | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | /** | 
| 91 | 91 | * Special treatment for some FrontMatter variables. | 
| 92 | 92 | */ | 
| 93 | - private function handleSpecialFrontMatter() | |
| 93 | + private function handleSpecialFrontMatter () | |
| 94 | 94 |      { | 
| 95 | 95 | $this->handleDateField(); | 
| 96 | 96 | } | 
| @@ -98,7 +98,7 @@ discard block | ||
| 98 | 98 | /** | 
| 99 | 99 | * Special treatment for the `date` field in FrontMatter that creates three new variables: year, month, day. | 
| 100 | 100 | */ | 
| 101 | - private function handleDateField() | |
| 101 | + private function handleDateField () | |
| 102 | 102 |      { | 
| 103 | 103 | if (!isset($this->frontMatter['date'])) | 
| 104 | 104 |          { | 
| @@ -126,7 +126,7 @@ discard block | ||
| 126 | 126 | * | 
| 127 | 127 | * @param array $yaml | 
| 128 | 128 | */ | 
| 129 | - private function evaluateBlock(&$yaml) | |
| 129 | + private function evaluateBlock (&$yaml) | |
| 130 | 130 |      { | 
| 131 | 131 | ++$this->nestingLevel; | 
| 132 | 132 | |
| @@ -165,7 +165,7 @@ discard block | ||
| 165 | 165 | * | 
| 166 | 166 | * @return array | 
| 167 | 167 | */ | 
| 168 | - private function evaluateExpandableField($key, $fmStatement) | |
| 168 | + private function evaluateExpandableField ($key, $fmStatement) | |
| 169 | 169 |      { | 
| 170 | 170 | if (!is_array($fmStatement)) | 
| 171 | 171 |          { | 
| @@ -203,7 +203,7 @@ discard block | ||
| 203 | 203 | * | 
| 204 | 204 | * @return array | 
| 205 | 205 | */ | 
| 206 | - private function evaluateArrayType($frontMatterKey, $expandableValue, $arrayVariableNames) | |
| 206 | + private function evaluateArrayType ($frontMatterKey, $expandableValue, $arrayVariableNames) | |
| 207 | 207 |      { | 
| 208 | 208 | if (!is_array($expandableValue)) | 
| 209 | 209 |          { | 
| @@ -251,7 +251,7 @@ discard block | ||
| 251 | 251 | * | 
| 252 | 252 | * @return string The final string with variables evaluated | 
| 253 | 253 | */ | 
| 254 | - private function evaluateBasicType($key, $string, $ignoreArrays = false) | |
| 254 | + private function evaluateBasicType ($key, $string, $ignoreArrays = false) | |
| 255 | 255 |      { | 
| 256 | 256 | $variables = $this->getFrontMatterVariables($string); | 
| 257 | 257 | |
| @@ -286,7 +286,7 @@ discard block | ||
| 286 | 286 | * | 
| 287 | 287 | * @return string[] | 
| 288 | 288 | */ | 
| 289 | - private function getFrontMatterVariables($string) | |
| 289 | + private function getFrontMatterVariables ($string) | |
| 290 | 290 |      { | 
| 291 | 291 | $variables = array(); | 
| 292 | 292 | |
| @@ -307,7 +307,7 @@ discard block | ||
| 307 | 307 | * | 
| 308 | 308 | * @return mixed | 
| 309 | 309 | */ | 
| 310 | - private function getVariableValue($key, $varName) | |
| 310 | + private function getVariableValue ($key, $varName) | |
| 311 | 311 |      { | 
| 312 | 312 | if (!isset($this->frontMatter[$varName])) | 
| 313 | 313 |          { | 
| @@ -326,7 +326,7 @@ discard block | ||
| 326 | 326 | * | 
| 327 | 327 | * @return bool|\DateTime | 
| 328 | 328 | */ | 
| 329 | - private function castDateTimeTimezone($epochTime) | |
| 329 | + private function castDateTimeTimezone ($epochTime) | |
| 330 | 330 |      { | 
| 331 | 331 | $timezone = new \DateTimeZone(date_default_timezone_get()); | 
| 332 | 332 |          $value = \DateTime::createFromFormat('U', $epochTime); | 
| @@ -340,7 +340,7 @@ discard block | ||
| 340 | 340 | * | 
| 341 | 341 | * @return bool|\DateTime | 
| 342 | 342 | */ | 
| 343 | - private function guessDateTime($guess) | |
| 343 | + private function guessDateTime ($guess) | |
| 344 | 344 |      { | 
| 345 | 345 | if ($guess instanceof \DateTime) | 
| 346 | 346 |          { | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | /** | 
| 98 | 98 | * @TODO 1.0.0 Remove support for 'base' in next major release; it has been replaced by 'baseurl' | 
| 99 | 99 | * | 
| 100 | - * @return mixed|null | |
| 100 | + * @return string | |
| 101 | 101 | */ | 
| 102 | 102 | public function getBaseUrl() | 
| 103 | 103 |      { | 
| @@ -168,6 +168,9 @@ discard block | ||
| 168 | 168 | return $this->configuration['twig']['autoescape']; | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | + /** | |
| 172 | + * @return string|false | |
| 173 | + */ | |
| 171 | 174 | public function getRedirectTemplate() | 
| 172 | 175 |      { | 
| 173 | 176 | return $this->configuration['templates']['redirect']; | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | /** | 
| 47 | 47 | * Configuration constructor. | 
| 48 | 48 | */ | 
| 49 | - public function __construct() | |
| 49 | + public function __construct () | |
| 50 | 50 |      { | 
| 51 | 51 | $this->configuration = array(); | 
| 52 | 52 | $this->fs = new Filesystem(); | 
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | * @param string|null $configFile The path to the configuration file. If null, the default configuration will be | 
| 61 | 61 | * used | 
| 62 | 62 | */ | 
| 63 | - public function parseConfiguration($configFile = null) | |
| 63 | + public function parseConfiguration ($configFile = null) | |
| 64 | 64 |      { | 
| 65 | 65 | if ($this->fs->exists($configFile)) | 
| 66 | 66 |          { | 
| @@ -84,12 +84,12 @@ discard block | ||
| 84 | 84 | /** | 
| 85 | 85 |       * {@inheritdoc} | 
| 86 | 86 | */ | 
| 87 | - public function setLogger(LoggerInterface $logger) | |
| 87 | + public function setLogger (LoggerInterface $logger) | |
| 88 | 88 |      { | 
| 89 | 89 | $this->output = $logger; | 
| 90 | 90 | } | 
| 91 | 91 | |
| 92 | - public function isDebug() | |
| 92 | + public function isDebug () | |
| 93 | 93 |      { | 
| 94 | 94 |          return $this->returnConfigOption('debug', false); | 
| 95 | 95 | } | 
| @@ -99,7 +99,7 @@ discard block | ||
| 99 | 99 | * | 
| 100 | 100 | * @return mixed|null | 
| 101 | 101 | */ | 
| 102 | - public function getBaseUrl() | |
| 102 | + public function getBaseUrl () | |
| 103 | 103 |      { | 
| 104 | 104 |          $base = $this->returnConfigOption('base'); | 
| 105 | 105 |          $baseUrl = $this->returnConfigOption('baseurl'); | 
| @@ -115,7 +115,7 @@ discard block | ||
| 115 | 115 | /** | 
| 116 | 116 | * @return string[] | 
| 117 | 117 | */ | 
| 118 | - public function getDataFolders() | |
| 118 | + public function getDataFolders () | |
| 119 | 119 |      { | 
| 120 | 120 |          return $this->returnConfigOption('data'); | 
| 121 | 121 | } | 
| @@ -123,52 +123,52 @@ discard block | ||
| 123 | 123 | /** | 
| 124 | 124 | * @return string[] | 
| 125 | 125 | */ | 
| 126 | - public function getDataSets() | |
| 126 | + public function getDataSets () | |
| 127 | 127 |      { | 
| 128 | 128 |          return $this->returnConfigOption('datasets'); | 
| 129 | 129 | } | 
| 130 | 130 | |
| 131 | - public function getIncludes() | |
| 131 | + public function getIncludes () | |
| 132 | 132 |      { | 
| 133 | 133 |          return $this->returnConfigOption('include', array()); | 
| 134 | 134 | } | 
| 135 | 135 | |
| 136 | - public function getExcludes() | |
| 136 | + public function getExcludes () | |
| 137 | 137 |      { | 
| 138 | 138 |          return $this->returnConfigOption('exclude', array()); | 
| 139 | 139 | } | 
| 140 | 140 | |
| 141 | - public function getTheme() | |
| 141 | + public function getTheme () | |
| 142 | 142 |      { | 
| 143 | 143 |          return $this->returnConfigOption('theme'); | 
| 144 | 144 | } | 
| 145 | 145 | |
| 146 | - public function getConfiguration() | |
| 146 | + public function getConfiguration () | |
| 147 | 147 |      { | 
| 148 | 148 | return $this->configuration; | 
| 149 | 149 | } | 
| 150 | 150 | |
| 151 | - public function getPageViewFolders() | |
| 151 | + public function getPageViewFolders () | |
| 152 | 152 |      { | 
| 153 | 153 |          return $this->returnConfigOption('pageviews'); | 
| 154 | 154 | } | 
| 155 | 155 | |
| 156 | - public function getTargetFolder() | |
| 156 | + public function getTargetFolder () | |
| 157 | 157 |      { | 
| 158 | 158 |          return $this->returnConfigOption('target'); | 
| 159 | 159 | } | 
| 160 | 160 | |
| 161 | - public function getCollectionsFolders() | |
| 161 | + public function getCollectionsFolders () | |
| 162 | 162 |      { | 
| 163 | 163 |          return $this->returnConfigOption('collections'); | 
| 164 | 164 | } | 
| 165 | 165 | |
| 166 | - public function getTwigAutoescape() | |
| 166 | + public function getTwigAutoescape () | |
| 167 | 167 |      { | 
| 168 | 168 | return $this->configuration['twig']['autoescape']; | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | - public function getRedirectTemplate() | |
| 171 | + public function getRedirectTemplate () | |
| 172 | 172 |      { | 
| 173 | 173 | return $this->configuration['templates']['redirect']; | 
| 174 | 174 | } | 
| @@ -181,12 +181,12 @@ discard block | ||
| 181 | 181 | * | 
| 182 | 182 | * @return mixed|null | 
| 183 | 183 | */ | 
| 184 | - private function returnConfigOption($name, $default = null) | |
| 184 | + private function returnConfigOption ($name, $default = null) | |
| 185 | 185 |      { | 
| 186 | 186 | return isset($this->configuration[$name]) ? $this->configuration[$name] : $default; | 
| 187 | 187 | } | 
| 188 | 188 | |
| 189 | - private function defaultConfiguration() | |
| 189 | + private function defaultConfiguration () | |
| 190 | 190 |      { | 
| 191 | 191 | $defaultConfig = array( | 
| 192 | 192 | 'baseurl' => '', | 
| @@ -210,7 +210,7 @@ discard block | ||
| 210 | 210 | $this->configuration = ArrayUtilities::array_merge_defaults($defaultConfig, $this->configuration, 'name'); | 
| 211 | 211 | } | 
| 212 | 212 | |
| 213 | - private function handleDeprecations() | |
| 213 | + private function handleDeprecations () | |
| 214 | 214 |      { | 
| 215 | 215 | // @TODO 1.0.0 handle 'base' deprecation in _config.yml | 
| 216 | 216 |          $base = $this->returnConfigOption('base'); | 
| @@ -174,7 +174,7 @@ | ||
| 174 | 174 | /** | 
| 175 | 175 | * Get the original file path. | 
| 176 | 176 | * | 
| 177 | - * @return string | |
| 177 | + * @return SplFileInfo | |
| 178 | 178 | */ | 
| 179 | 179 | final public function getFilePath() | 
| 180 | 180 |      { | 
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 | * @throws IOException The file was not a valid ContentItem. This would meam there was no front matter or | 
| 137 | 137 | * no body | 
| 138 | 138 | */ | 
| 139 | - public function __construct($filePath) | |
| 139 | + public function __construct ($filePath) | |
| 140 | 140 |      { | 
| 141 | 141 |          $this->frontMatterBlacklist = array('permalink', 'redirects'); | 
| 142 | 142 | $this->writableFrontMatter = array(); | 
| @@ -159,14 +159,14 @@ discard block | ||
| 159 | 159 | * | 
| 160 | 160 | * @return string | 
| 161 | 161 | */ | 
| 162 | - abstract public function getContent(); | |
| 162 | + abstract public function getContent (); | |
| 163 | 163 | |
| 164 | 164 | /** | 
| 165 | 165 | * Get the extension of the current file. | 
| 166 | 166 | * | 
| 167 | 167 | * @return string | 
| 168 | 168 | */ | 
| 169 | - final public function getExtension() | |
| 169 | + final public function getExtension () | |
| 170 | 170 |      { | 
| 171 | 171 | return $this->extension; | 
| 172 | 172 | } | 
| @@ -176,7 +176,7 @@ discard block | ||
| 176 | 176 | * | 
| 177 | 177 | * @return string | 
| 178 | 178 | */ | 
| 179 | - final public function getFilePath() | |
| 179 | + final public function getFilePath () | |
| 180 | 180 |      { | 
| 181 | 181 | return $this->filePath; | 
| 182 | 182 | } | 
| @@ -186,7 +186,7 @@ discard block | ||
| 186 | 186 | * | 
| 187 | 187 | * @return int | 
| 188 | 188 | */ | 
| 189 | - final public function getLineOffset() | |
| 189 | + final public function getLineOffset () | |
| 190 | 190 |      { | 
| 191 | 191 | return $this->lineOffset; | 
| 192 | 192 | } | 
| @@ -196,7 +196,7 @@ discard block | ||
| 196 | 196 | * | 
| 197 | 197 | * @return string | 
| 198 | 198 | */ | 
| 199 | - final public function getName() | |
| 199 | + final public function getName () | |
| 200 | 200 |      { | 
| 201 | 201 | return $this->fs->getBaseName($this->filePath); | 
| 202 | 202 | } | 
| @@ -206,7 +206,7 @@ discard block | ||
| 206 | 206 | * | 
| 207 | 207 | * @return string | 
| 208 | 208 | */ | 
| 209 | - final public function getRelativeFilePath() | |
| 209 | + final public function getRelativeFilePath () | |
| 210 | 210 |      { | 
| 211 | 211 | if ($this->filePath instanceof SplFileInfo) | 
| 212 | 212 |          { | 
| @@ -222,7 +222,7 @@ discard block | ||
| 222 | 222 | * | 
| 223 | 223 | * @return string | 
| 224 | 224 | */ | 
| 225 | - final public function getTargetFile() | |
| 225 | + final public function getTargetFile () | |
| 226 | 226 |      { | 
| 227 | 227 | $permalink = $this->getPermalink(); | 
| 228 | 228 | $missingFile = (substr($permalink, -1) == '/'); | 
| @@ -244,7 +244,7 @@ discard block | ||
| 244 | 244 | * | 
| 245 | 245 | * @return bool | 
| 246 | 246 | */ | 
| 247 | - final public function hasTwigDependency($namespace, $needle) | |
| 247 | + final public function hasTwigDependency ($namespace, $needle) | |
| 248 | 248 |      { | 
| 249 | 249 | return in_array($needle, $this->dataDependencies[$namespace]); | 
| 250 | 250 | } | 
| @@ -252,7 +252,7 @@ discard block | ||
| 252 | 252 | /** | 
| 253 | 253 | * Read the file, and parse its contents. | 
| 254 | 254 | */ | 
| 255 | - final public function refreshFileContent() | |
| 255 | + final public function refreshFileContent () | |
| 256 | 256 |      { | 
| 257 | 257 | // This function can be called after the initial object was created and the file may have been deleted since the | 
| 258 | 258 | // creation of the object. | 
| @@ -305,7 +305,7 @@ discard block | ||
| 305 | 305 | * | 
| 306 | 306 | * @param string $filter 'collections' or 'data' | 
| 307 | 307 | */ | 
| 308 | - private function findTwigDataDependencies($filter) | |
| 308 | + private function findTwigDataDependencies ($filter) | |
| 309 | 309 |      { | 
| 310 | 310 |          $regex = '/{[{%](?:.+)?(?:' . $filter . ')(?:\.|\[\')(\w+)(?:\'\])?.+[%}]}/'; | 
| 311 | 311 | $results = array(); | 
| @@ -326,7 +326,7 @@ discard block | ||
| 326 | 326 | * | 
| 327 | 327 | * @return string | 
| 328 | 328 | */ | 
| 329 | - final public function getPermalink() | |
| 329 | + final public function getPermalink () | |
| 330 | 330 |      { | 
| 331 | 331 | if (!is_null($this->permalink)) | 
| 332 | 332 |          { | 
| @@ -365,7 +365,7 @@ discard block | ||
| 365 | 365 | * | 
| 366 | 366 | * @return string[] | 
| 367 | 367 | */ | 
| 368 | - final public function getRedirects() | |
| 368 | + final public function getRedirects () | |
| 369 | 369 |      { | 
| 370 | 370 | if (is_null($this->redirects)) | 
| 371 | 371 |          { | 
| @@ -381,7 +381,7 @@ discard block | ||
| 381 | 381 | * | 
| 382 | 382 | * @return string | 
| 383 | 383 | */ | 
| 384 | - private function getPathPermalink() | |
| 384 | + private function getPathPermalink () | |
| 385 | 385 |      { | 
| 386 | 386 | // Remove the protocol of the path, if there is one and prepend a '/' to the beginning | 
| 387 | 387 |          $cleanPath = preg_replace('/[\w|\d]+:\/\//', '', $this->getRelativeFilePath()); | 
| @@ -413,7 +413,7 @@ discard block | ||
| 413 | 413 | * | 
| 414 | 414 | * @return string $permalink The sanitized permalink | 
| 415 | 415 | */ | 
| 416 | - private function sanitizePermalink($permalink) | |
| 416 | + private function sanitizePermalink ($permalink) | |
| 417 | 417 |      { | 
| 418 | 418 | // Remove multiple '/' together | 
| 419 | 419 |          $permalink = preg_replace('/\/+/', '/', $permalink); | 
| @@ -448,7 +448,7 @@ discard block | ||
| 448 | 448 | /** | 
| 449 | 449 |       * {@inheritdoc} | 
| 450 | 450 | */ | 
| 451 | - final public function evaluateFrontMatter($variables = null) | |
| 451 | + final public function evaluateFrontMatter ($variables = null) | |
| 452 | 452 |      { | 
| 453 | 453 | if (!is_null($variables)) | 
| 454 | 454 |          { | 
| @@ -460,7 +460,7 @@ discard block | ||
| 460 | 460 | /** | 
| 461 | 461 |       * {@inheritdoc} | 
| 462 | 462 | */ | 
| 463 | - final public function getFrontMatter($evaluateYaml = true) | |
| 463 | + final public function getFrontMatter ($evaluateYaml = true) | |
| 464 | 464 |      { | 
| 465 | 465 | if (is_null($this->frontMatter)) | 
| 466 | 466 |          { | 
| @@ -477,7 +477,7 @@ discard block | ||
| 477 | 477 | /** | 
| 478 | 478 |       * {@inheritdoc} | 
| 479 | 479 | */ | 
| 480 | - final public function hasExpandedFrontMatter() | |
| 480 | + final public function hasExpandedFrontMatter () | |
| 481 | 481 |      { | 
| 482 | 482 | return !is_null($this->frontMatterParser) && $this->frontMatterParser->hasExpansion(); | 
| 483 | 483 | } | 
| @@ -485,7 +485,7 @@ discard block | ||
| 485 | 485 | /** | 
| 486 | 486 |       * {@inheritdoc. | 
| 487 | 487 | */ | 
| 488 | - final public function appendFrontMatter(array $frontMatter) | |
| 488 | + final public function appendFrontMatter (array $frontMatter) | |
| 489 | 489 |      { | 
| 490 | 490 | foreach ($frontMatter as $key => $value) | 
| 491 | 491 |          { | 
| @@ -496,7 +496,7 @@ discard block | ||
| 496 | 496 | /** | 
| 497 | 497 |       * {@inheritdoc. | 
| 498 | 498 | */ | 
| 499 | - final public function deleteFrontMatter($key) | |
| 499 | + final public function deleteFrontMatter ($key) | |
| 500 | 500 |      { | 
| 501 | 501 | if (!isset($this->writableFrontMatter[$key])) | 
| 502 | 502 |          { | 
| @@ -509,7 +509,7 @@ discard block | ||
| 509 | 509 | /** | 
| 510 | 510 |       * {@inheritdoc. | 
| 511 | 511 | */ | 
| 512 | - final public function setFrontMatter(array $frontMatter) | |
| 512 | + final public function setFrontMatter (array $frontMatter) | |
| 513 | 513 |      { | 
| 514 | 514 | if (!is_array($frontMatter)) | 
| 515 | 515 |          { | 
| @@ -526,7 +526,7 @@ discard block | ||
| 526 | 526 | * | 
| 527 | 527 | * @throws YamlVariableUndefinedException A FrontMatter variable used does not exist | 
| 528 | 528 | */ | 
| 529 | - private function evaluateYaml(&$yaml) | |
| 529 | + private function evaluateYaml (&$yaml) | |
| 530 | 530 |      { | 
| 531 | 531 | try | 
| 532 | 532 |          { | 
| @@ -546,7 +546,7 @@ discard block | ||
| 546 | 546 | /** | 
| 547 | 547 |       * {@inheritdoc} | 
| 548 | 548 | */ | 
| 549 | - public function offsetSet($offset, $value) | |
| 549 | + public function offsetSet ($offset, $value) | |
| 550 | 550 |      { | 
| 551 | 551 | if (is_null($offset)) | 
| 552 | 552 |          { | 
| @@ -559,7 +559,7 @@ discard block | ||
| 559 | 559 | /** | 
| 560 | 560 |       * {@inheritdoc} | 
| 561 | 561 | */ | 
| 562 | - public function offsetExists($offset) | |
| 562 | + public function offsetExists ($offset) | |
| 563 | 563 |      { | 
| 564 | 564 | if (isset($this->writableFrontMatter[$offset]) || isset($this->frontMatter[$offset])) | 
| 565 | 565 |          { | 
| @@ -574,7 +574,7 @@ discard block | ||
| 574 | 574 | /** | 
| 575 | 575 |       * {@inheritdoc} | 
| 576 | 576 | */ | 
| 577 | - public function offsetUnset($offset) | |
| 577 | + public function offsetUnset ($offset) | |
| 578 | 578 |      { | 
| 579 | 579 | unset($this->writableFrontMatter[$offset]); | 
| 580 | 580 | } | 
| @@ -582,7 +582,7 @@ discard block | ||
| 582 | 582 | /** | 
| 583 | 583 |       * {@inheritdoc} | 
| 584 | 584 | */ | 
| 585 | - public function offsetGet($offset) | |
| 585 | + public function offsetGet ($offset) | |
| 586 | 586 |      { | 
| 587 | 587 | $fxnCall = 'get' . ucfirst($offset); | 
| 588 | 588 | |
| @@ -349,6 +349,9 @@ discard block | ||
| 349 | 349 | $this->noClean = $noClean; | 
| 350 | 350 | } | 
| 351 | 351 | |
| 352 | + /** | |
| 353 | + * @param string $filePath | |
| 354 | + */ | |
| 352 | 355 | private function creationWatcher($filePath) | 
| 353 | 356 |      { | 
| 354 | 357 |          $this->output->writeln(sprintf('File creation detected: %s', $filePath)); | 
| @@ -390,6 +393,9 @@ discard block | ||
| 390 | 393 | } | 
| 391 | 394 | } | 
| 392 | 395 | |
| 396 | + /** | |
| 397 | + * @param string $filePath | |
| 398 | + */ | |
| 393 | 399 | private function modificationWatcher($filePath) | 
| 394 | 400 |      { | 
| 395 | 401 |          $this->output->writeln(sprintf('File change detected: %s', $filePath)); | 
| @@ -109,7 +109,7 @@ discard block | ||
| 109 | 109 | * | 
| 110 | 110 | * @param OutputInterface $output | 
| 111 | 111 | */ | 
| 112 | - public function __construct(OutputInterface $output) | |
| 112 | + public function __construct (OutputInterface $output) | |
| 113 | 113 |      { | 
| 114 | 114 | $this->output = new StakxLogger($output); | 
| 115 | 115 | $this->cm = new CollectionManager(); | 
| @@ -124,7 +124,7 @@ discard block | ||
| 124 | 124 | * | 
| 125 | 125 | * @param bool $tracking Whether or not to keep track of files as they're compiled to save time in 'watch' | 
| 126 | 126 | */ | 
| 127 | - public function build($tracking = false) | |
| 127 | + public function build ($tracking = false) | |
| 128 | 128 |      { | 
| 129 | 129 | // Configure the environment | 
| 130 | 130 | $this->createFolderStructure(!$this->noClean); | 
| @@ -210,7 +210,7 @@ discard block | ||
| 210 | 210 | $this->am->copyFiles(); | 
| 211 | 211 | } | 
| 212 | 212 | |
| 213 | - public function watch() | |
| 213 | + public function watch () | |
| 214 | 214 |      { | 
| 215 | 215 |          $this->output->writeln('Building website...'); | 
| 216 | 216 | $this->build(true); | 
| @@ -261,7 +261,7 @@ discard block | ||
| 261 | 261 | /** | 
| 262 | 262 | * @return Configuration | 
| 263 | 263 | */ | 
| 264 | - public function getConfiguration() | |
| 264 | + public function getConfiguration () | |
| 265 | 265 |      { | 
| 266 | 266 | return $this->configuration; | 
| 267 | 267 | } | 
| @@ -271,7 +271,7 @@ discard block | ||
| 271 | 271 | * | 
| 272 | 272 | * @throws \LogicException | 
| 273 | 273 | */ | 
| 274 | - public function setConfiguration($configFile) | |
| 274 | + public function setConfiguration ($configFile) | |
| 275 | 275 |      { | 
| 276 | 276 | if (!$this->fs->exists($configFile) && !$this->isConfLess()) | 
| 277 | 277 |          { | 
| @@ -296,7 +296,7 @@ discard block | ||
| 296 | 296 | * | 
| 297 | 297 | * @return bool True when being built with no configuration file | 
| 298 | 298 | */ | 
| 299 | - public function isConfLess() | |
| 299 | + public function isConfLess () | |
| 300 | 300 |      { | 
| 301 | 301 | return $this->confLess; | 
| 302 | 302 | } | 
| @@ -306,7 +306,7 @@ discard block | ||
| 306 | 306 | * | 
| 307 | 307 | * @param bool $status True when a website should be built without a configuration | 
| 308 | 308 | */ | 
| 309 | - public function setConfLess($status) | |
| 309 | + public function setConfLess ($status) | |
| 310 | 310 |      { | 
| 311 | 311 | $this->confLess = $status; | 
| 312 | 312 | } | 
| @@ -318,7 +318,7 @@ discard block | ||
| 318 | 318 | * | 
| 319 | 319 | * @return bool True when the website is being built in safe mode | 
| 320 | 320 | */ | 
| 321 | - public function isSafeMode() | |
| 321 | + public function isSafeMode () | |
| 322 | 322 |      { | 
| 323 | 323 | return $this->safeMode; | 
| 324 | 324 | } | 
| @@ -328,7 +328,7 @@ discard block | ||
| 328 | 328 | * | 
| 329 | 329 | * @param bool $bool True if a website should be built in safe mode | 
| 330 | 330 | */ | 
| 331 | - public function setSafeMode($bool) | |
| 331 | + public function setSafeMode ($bool) | |
| 332 | 332 |      { | 
| 333 | 333 | $this->safeMode = $bool; | 
| 334 | 334 | } | 
| @@ -336,7 +336,7 @@ discard block | ||
| 336 | 336 | /** | 
| 337 | 337 | * @return bool | 
| 338 | 338 | */ | 
| 339 | - public function isNoClean() | |
| 339 | + public function isNoClean () | |
| 340 | 340 |      { | 
| 341 | 341 | return $this->noClean; | 
| 342 | 342 | } | 
| @@ -344,12 +344,12 @@ discard block | ||
| 344 | 344 | /** | 
| 345 | 345 | * @param bool $noClean | 
| 346 | 346 | */ | 
| 347 | - public function setNoClean($noClean) | |
| 347 | + public function setNoClean ($noClean) | |
| 348 | 348 |      { | 
| 349 | 349 | $this->noClean = $noClean; | 
| 350 | 350 | } | 
| 351 | 351 | |
| 352 | - private function creationWatcher($filePath) | |
| 352 | + private function creationWatcher ($filePath) | |
| 353 | 353 |      { | 
| 354 | 354 |          $this->output->writeln(sprintf('File creation detected: %s', $filePath)); | 
| 355 | 355 | |
| @@ -390,7 +390,7 @@ discard block | ||
| 390 | 390 | } | 
| 391 | 391 | } | 
| 392 | 392 | |
| 393 | - private function modificationWatcher($filePath) | |
| 393 | + private function modificationWatcher ($filePath) | |
| 394 | 394 |      { | 
| 395 | 395 |          $this->output->writeln(sprintf('File change detected: %s', $filePath)); | 
| 396 | 396 | |
| @@ -434,7 +434,7 @@ discard block | ||
| 434 | 434 | * | 
| 435 | 435 | * @param bool $cleanDirectory Clean the target directory | 
| 436 | 436 | */ | 
| 437 | - private function createFolderStructure($cleanDirectory) | |
| 437 | + private function createFolderStructure ($cleanDirectory) | |
| 438 | 438 |      { | 
| 439 | 439 | $tarDir = $this->fs->absolutePath($this->configuration->getTargetFolder()); | 
| 440 | 440 | |
| @@ -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 |      { | 
| @@ -23,7 +23,7 @@ discard block | ||
| 23 | 23 | * | 
| 24 | 24 | * @return array | 
| 25 | 25 | */ | 
| 26 | - public function getFilters() | |
| 26 | + public function getFilters () | |
| 27 | 27 |      { | 
| 28 | 28 | return array( | 
| 29 | 29 |              new Twig_SimpleFilter('summary', 'twig_summary_filter'), | 
| @@ -37,13 +37,13 @@ discard block | ||
| 37 | 37 | * | 
| 38 | 38 | * @return string | 
| 39 | 39 | */ | 
| 40 | - public function getName() | |
| 40 | + public function getName () | |
| 41 | 41 |      { | 
| 42 | 42 | return 'Text'; | 
| 43 | 43 | } | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | -function twig_summary_filter($value, $paragraphCount = 1) | |
| 46 | +function twig_summary_filter ($value, $paragraphCount = 1) | |
| 47 | 47 |  { | 
| 48 | 48 |      if (function_exists('simplexml_load_string')) | 
| 49 | 49 |      { | 
| @@ -64,7 +64,7 @@ discard block | ||
| 64 | 64 | return $value; | 
| 65 | 65 | } | 
| 66 | 66 | |
| 67 | -function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') | |
| 67 | +function twig_truncate_filter (Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') | |
| 68 | 68 |  { | 
| 69 | 69 | if (mb_strlen($value, $env->getCharset()) > $length) | 
| 70 | 70 |      { | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | return $value; | 
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | -function twig_wordwrap_filter(Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) | |
| 88 | +function twig_wordwrap_filter (Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) | |
| 89 | 89 |  { | 
| 90 | 90 | $sentences = array(); | 
| 91 | 91 | |
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | |
| 12 | 12 | class CodeNode extends Base | 
| 13 | 13 |  { | 
| 14 | - public function render() | |
| 14 | + public function render () | |
| 15 | 15 |      { | 
| 16 | 16 | return '<pre><code class="hljs language-' . $this->language . '">' . $this->value . '</code></pre>'; | 
| 17 | 17 | } | 
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | |
| 13 | 13 | class WatchCommand extends BuildableCommand | 
| 14 | 14 |  { | 
| 15 | - protected function configure() | |
| 15 | + protected function configure () | |
| 16 | 16 |      { | 
| 17 | 17 | parent::configure(); | 
| 18 | 18 | |
| @@ -20,7 +20,7 @@ discard block | ||
| 20 | 20 |          $this->setDescription('Watch the source folder and rebuild the website as files change'); | 
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 23 | + protected function execute (InputInterface $input, OutputInterface $output) | |
| 24 | 24 |      { | 
| 25 | 25 | parent::execute($input, $output); | 
| 26 | 26 | |
| @@ -16,7 +16,7 @@ discard block | ||
| 16 | 16 | /** | 
| 17 | 17 |       * {@inheritdoc} | 
| 18 | 18 | */ | 
| 19 | - protected function configure() | |
| 19 | + protected function configure () | |
| 20 | 20 |      { | 
| 21 | 21 | parent::configure(); | 
| 22 | 22 | |
| @@ -27,7 +27,7 @@ discard block | ||
| 27 | 27 | /** | 
| 28 | 28 |       * {@inheritdoc} | 
| 29 | 29 | */ | 
| 30 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 30 | + protected function execute (InputInterface $input, OutputInterface $output) | |
| 31 | 31 |      { | 
| 32 | 32 | parent::execute($input, $output); | 
| 33 | 33 | |
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | /** | 
| 41 | 41 |       * {@inheritdoc} | 
| 42 | 42 | */ | 
| 43 | - protected function configure() | |
| 43 | + protected function configure () | |
| 44 | 44 |      { | 
| 45 | 45 | $this->fs = new Filesystem(); | 
| 46 | 46 | |
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 | /** | 
| 54 | 54 |       * {@inheritdoc} | 
| 55 | 55 | */ | 
| 56 | - protected function execute(InputInterface $input, OutputInterface $output) | |
| 56 | + protected function execute (InputInterface $input, OutputInterface $output) | |
| 57 | 57 |      { | 
| 58 | 58 | $this->website = new Website($output); | 
| 59 | 59 |          $this->website->setConfLess($input->getOption('no-conf')); | 
| @@ -65,7 +65,7 @@ discard block | ||
| 65 | 65 | * | 
| 66 | 66 | * @param InputInterface $input | 
| 67 | 67 | */ | 
| 68 | - protected function configureBuild(InputInterface $input) | |
| 68 | + protected function configureBuild (InputInterface $input) | |
| 69 | 69 |      { | 
| 70 | 70 |          $this->website->setConfiguration($input->getOption('conf')); | 
| 71 | 71 |          $this->website->setSafeMode($input->getOption('safe')); |