@@ -33,8 +33,7 @@ |
||
| 33 | 33 | $output->writeln(sprintf("Your site built successfully! It can be found at: %s", |
| 34 | 34 | $this->website->getConfiguration()->getTargetFolder() . DIRECTORY_SEPARATOR |
| 35 | 35 | )); |
| 36 | - } |
|
| 37 | - catch (\Exception $e) |
|
| 36 | + } catch (\Exception $e) |
|
| 38 | 37 | { |
| 39 | 38 | $output->writeln(sprintf("Your website failed to build with the following error: %s", |
| 40 | 39 | $e->getMessage() |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | )); |
| 29 | 29 | |
| 30 | 30 | $this->website->watch(); |
| 31 | - } |
|
| 32 | - catch (\Exception $e) |
|
| 31 | + } catch (\Exception $e) |
|
| 33 | 32 | { |
| 34 | 33 | $output->writeln(sprintf("Your website failed to build with the following error: %s", |
| 35 | 34 | $e->getMessage() |
@@ -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 | { |
@@ -88,8 +88,7 @@ |
||
| 88 | 88 | if ($newPageView->isDynamicPage()) |
| 89 | 89 | { |
| 90 | 90 | $this->dynamicPageViews[] = $newPageView; |
| 91 | - } |
|
| 92 | - else |
|
| 91 | + } else |
|
| 93 | 92 | { |
| 94 | 93 | $this->addToSiteMenu($newPageView->getFrontMatter()); |
| 95 | 94 | $this->staticPageViews[] = $newPageView; |
@@ -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 | { |
@@ -127,8 +127,7 @@ |
||
| 127 | 127 | { |
| 128 | 128 | $this->handleDependencies($ext); |
| 129 | 129 | $dataItems[$name] = $this->$fxnName($content); |
| 130 | - } |
|
| 131 | - else |
|
| 130 | + } else |
|
| 132 | 131 | { |
| 133 | 132 | $this->output->warning("There is no function to handle '$ext' file format."); |
| 134 | 133 | } |
@@ -20,18 +20,15 @@ |
||
| 20 | 20 | $valueMerged = true; |
| 21 | 21 | |
| 22 | 22 | break; |
| 23 | - } |
|
| 24 | - else if ($mergedKey == $key) |
|
| 23 | + } else if ($mergedKey == $key) |
|
| 25 | 24 | { |
| 26 | 25 | if (is_numeric($mergedKey)) |
| 27 | 26 | { |
| 28 | 27 | $merged[] = $value; |
| 29 | - } |
|
| 30 | - else if (is_array($item)) |
|
| 28 | + } else if (is_array($item)) |
|
| 31 | 29 | { |
| 32 | 30 | $item = array_unique(array_merge($item, $value)); |
| 33 | - } |
|
| 34 | - else |
|
| 31 | + } else |
|
| 35 | 32 | { |
| 36 | 33 | $item = $value; |
| 37 | 34 | } |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $highlighted = $this->highlighter->highlight($language, $block['element']['text']['text']); |
| 26 | 26 | $block['element']['text']['text'] = $highlighted->value; |
| 27 | - } |
|
| 28 | - catch (\DomainException $exception) {} |
|
| 27 | + } catch (\DomainException $exception) {} |
|
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | return $block; |
@@ -182,8 +182,7 @@ discard block |
||
| 182 | 182 | try |
| 183 | 183 | { |
| 184 | 184 | $this->build(false); |
| 185 | - } |
|
| 186 | - catch (\Exception $e) |
|
| 185 | + } catch (\Exception $e) |
|
| 187 | 186 | { |
| 188 | 187 | $this->output->error(sprintf("Your website failed to build with the following error: %s", |
| 189 | 188 | $e->getMessage() |
@@ -236,8 +235,7 @@ discard block |
||
| 236 | 235 | if (count($_paths) > 1 && (in_array($_paths[0], $collectionDirs) || in_array($_paths[0], $pageViewDirs))) |
| 237 | 236 | { |
| 238 | 237 | |
| 239 | - } |
|
| 240 | - else |
|
| 238 | + } else |
|
| 241 | 239 | { |
| 242 | 240 | $this->copyToCompiledSite($filePath); |
| 243 | 241 | } |
@@ -324,8 +322,7 @@ discard block |
||
| 324 | 322 | try |
| 325 | 323 | { |
| 326 | 324 | $loader->addPath($this->fs->absolutePath('_themes', $this->configuration->getTheme())); |
| 327 | - } |
|
| 328 | - catch (\Twig_Error_Loader $e) |
|
| 325 | + } catch (\Twig_Error_Loader $e) |
|
| 329 | 326 | { |
| 330 | 327 | $this->output->error("The following theme could not be loaded: {theme}", array( |
| 331 | 328 | "theme" => $theme |
@@ -436,8 +433,7 @@ discard block |
||
| 436 | 433 | try |
| 437 | 434 | { |
| 438 | 435 | $this->outputDirectory->copyFile($filePath, $siteTargetPath); |
| 439 | - } |
|
| 440 | - catch (\Exception $e) |
|
| 436 | + } catch (\Exception $e) |
|
| 441 | 437 | { |
| 442 | 438 | $this->output->error($e->getMessage()); |
| 443 | 439 | } |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | try |
| 48 | 48 | { |
| 49 | 49 | $this->configuration = Yaml::parse(file_get_contents($configFile)); |
| 50 | - } |
|
| 51 | - catch (ParseException $e) |
|
| 50 | + } catch (ParseException $e) |
|
| 52 | 51 | { |
| 53 | 52 | $this->output->error("Parsing the configuration failed: {message}", array( |
| 54 | 53 | "message" => $e->getMessage() |
@@ -158,8 +157,7 @@ discard block |
||
| 158 | 157 | if (is_array($this->configuration)) |
| 159 | 158 | { |
| 160 | 159 | $this->configuration = ArrayUtilities::array_merge_defaults($defaultConfig, $this->configuration, 'name'); |
| 161 | - } |
|
| 162 | - else |
|
| 160 | + } else |
|
| 163 | 161 | { |
| 164 | 162 | $this->configuration = $defaultConfig; |
| 165 | 163 | } |
@@ -177,10 +177,12 @@ discard block |
||
| 177 | 177 | break; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - if (!is_null($pd)) // No parser needed |
|
| 180 | + if (!is_null($pd)) { |
|
| 181 | + // No parser needed |
|
| 181 | 182 | { |
| 182 | 183 | $this->bodyContent = $pd->parse($this->bodyContent); |
| 183 | 184 | } |
| 185 | + } |
|
| 184 | 186 | |
| 185 | 187 | $this->bodyContentEvaluated = true; |
| 186 | 188 | } |
@@ -200,8 +202,7 @@ discard block |
||
| 200 | 202 | if ($this->frontMatter === null) |
| 201 | 203 | { |
| 202 | 204 | $this->frontMatter = array(); |
| 203 | - } |
|
| 204 | - else if (!$this->frontMatterEvaluated && $evaluateYaml && !empty($evaluateYaml)) |
|
| 205 | + } else if (!$this->frontMatterEvaluated && $evaluateYaml && !empty($evaluateYaml)) |
|
| 205 | 206 | { |
| 206 | 207 | $this->evaluateYaml($this->frontMatter); |
| 207 | 208 | $this->frontMatterEvaluated = true; |
@@ -274,8 +275,7 @@ discard block |
||
| 274 | 275 | if (is_array($yaml[$key])) |
| 275 | 276 | { |
| 276 | 277 | $this->evaluateYaml($yaml[$key]); |
| 277 | - } |
|
| 278 | - else |
|
| 278 | + } else |
|
| 279 | 279 | { |
| 280 | 280 | $yaml[$key] = $this->evaluateYamlVar($value, $this->frontMatter); |
| 281 | 281 | } |
@@ -328,8 +328,7 @@ discard block |
||
| 328 | 328 | { |
| 329 | 329 | // Coming from a string variable |
| 330 | 330 | $itemDate = new \DateTime($this->frontMatter['date']); |
| 331 | - } |
|
| 332 | - catch (\Exception $e) |
|
| 331 | + } catch (\Exception $e) |
|
| 333 | 332 | { |
| 334 | 333 | // YAML has parsed them to Epoch time |
| 335 | 334 | $itemDate = \DateTime::createFromFormat('U', $this->frontMatter['date']); |