@@ -28,7 +28,7 @@ |
||
28 | 28 | /** |
29 | 29 | * {@inheritdoc} |
30 | 30 | */ |
31 | - public function setLogger(LoggerInterface $logger) |
|
31 | + public function setLogger (LoggerInterface $logger) |
|
32 | 32 | { |
33 | 33 | $this->output = $logger; |
34 | 34 | } |
@@ -140,7 +140,7 @@ |
||
140 | 140 | * |
141 | 141 | * @return string |
142 | 142 | */ |
143 | - private function interpolate($message, array $context) |
|
143 | + private function interpolate ($message, array $context) |
|
144 | 144 | { |
145 | 145 | // build a replacement array with braces around the context keys |
146 | 146 | $replace = array(); |
@@ -93,7 +93,8 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function log ($level, $message, array $context = array()) |
95 | 95 | { |
96 | - if (!isset($this->verbosityLevelMap[$level])) { |
|
96 | + if (!isset($this->verbosityLevelMap[$level])) |
|
97 | + { |
|
97 | 98 | throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); |
98 | 99 | } |
99 | 100 | |
@@ -144,8 +145,10 @@ discard block |
||
144 | 145 | { |
145 | 146 | // build a replacement array with braces around the context keys |
146 | 147 | $replace = array(); |
147 | - foreach ($context as $key => $val) { |
|
148 | - if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
|
148 | + foreach ($context as $key => $val) |
|
149 | + { |
|
150 | + if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) |
|
151 | + { |
|
149 | 152 | $replace[sprintf('{%s}', $key)] = $val; |
150 | 153 | } |
151 | 154 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Configuration constructor. |
36 | 36 | */ |
37 | - public function __construct() |
|
37 | + public function __construct () |
|
38 | 38 | { |
39 | 39 | $this->configuration = array(); |
40 | 40 | $this->fs = new Filesystem(); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * {@inheritdoc} |
66 | 66 | */ |
67 | - public function setLogger(LoggerInterface $logger) |
|
67 | + public function setLogger (LoggerInterface $logger) |
|
68 | 68 | { |
69 | 69 | $this->output = $logger; |
70 | 70 | } |
@@ -305,11 +305,17 @@ |
||
305 | 305 | $this->noClean = $noClean; |
306 | 306 | } |
307 | 307 | |
308 | + /** |
|
309 | + * @param string $filePath |
|
310 | + */ |
|
308 | 311 | private function creationWatcher ($filePath) |
309 | 312 | { |
310 | 313 | $this->output->writeln(sprintf("File creation detected: %s", $filePath)); |
311 | 314 | } |
312 | 315 | |
316 | + /** |
|
317 | + * @param string $filePath |
|
318 | + */ |
|
313 | 319 | private function modificationWatcher ($filePath) |
314 | 320 | { |
315 | 321 | $this->output->writeln(sprintf("File change detected: %s", $filePath)); |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | $this->pm->configureTwig($this->getConfiguration(), array( |
140 | 140 | 'safe' => $this->safeMode, |
141 | 141 | 'globals' => array( |
142 | - array('name' => 'site', 'value' => $this->getConfiguration()->getConfiguration()), |
|
142 | + array('name' => 'site', 'value' => $this->getConfiguration()->getConfiguration()), |
|
143 | 143 | array('name' => 'collections', 'value' => $this->cm->getCollections()), |
144 | - array('name' => 'menu', 'value' => $this->pm->getSiteMenu()), |
|
145 | - array('name' => 'pages', 'value' => $this->pm->getFlatPages()), |
|
146 | - array('name' => 'data', 'value' => $this->dm->getDataItems()) |
|
144 | + array('name' => 'menu', 'value' => $this->pm->getSiteMenu()), |
|
145 | + array('name' => 'pages', 'value' => $this->pm->getFlatPages()), |
|
146 | + array('name' => 'data', 'value' => $this->dm->getDataItems()) |
|
147 | 147 | ) |
148 | 148 | )); |
149 | 149 | $this->pm->compileAll(); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | /** |
310 | 310 | * @return boolean |
311 | 311 | */ |
312 | - public function isNoClean() |
|
312 | + public function isNoClean () |
|
313 | 313 | { |
314 | 314 | return $this->noClean; |
315 | 315 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | /** |
318 | 318 | * @param boolean $noClean |
319 | 319 | */ |
320 | - public function setNoClean($noClean) |
|
320 | + public function setNoClean ($noClean) |
|
321 | 321 | { |
322 | 322 | $this->noClean = $noClean; |
323 | 323 | } |
@@ -36,8 +36,8 @@ |
||
36 | 36 | * FileExplorer constructor. |
37 | 37 | * |
38 | 38 | * @param \RecursiveIterator $iterator |
39 | - * @param array $excludes |
|
40 | - * @param array $includes |
|
39 | + * @param string[] $excludes |
|
40 | + * @param string[] $includes |
|
41 | 41 | */ |
42 | 42 | public function __construct(\RecursiveIterator $iterator, array $excludes = array(), array $includes = array()) |
43 | 43 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * A bitwise flag to have FileExplorer search files starting with a period as well |
22 | 22 | */ |
23 | - const ALLOW_DOT_FILES = 0x2; |
|
23 | + const ALLOW_DOT_FILES = 0x2; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * A list of common version control folders to ignore. |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @var string[] |
38 | 38 | */ |
39 | - public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn'); |
|
39 | + public static $vcsPatterns = array('.git', '.hg', '.svn', '_svn'); |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * A list of phrases to exclude from the search |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @param array $includes |
68 | 68 | * @param int|null $flags |
69 | 69 | */ |
70 | - public function __construct(\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
70 | + public function __construct (\RecursiveIterator $iterator, array $excludes = array(), array $includes = array(), $flags = null) |
|
71 | 71 | { |
72 | 72 | parent::__construct($iterator); |
73 | 73 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** |
80 | 80 | * @return string |
81 | 81 | */ |
82 | - public function __toString() |
|
82 | + public function __toString () |
|
83 | 83 | { |
84 | 84 | return $this->current()->getFilename(); |
85 | 85 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * |
106 | 106 | * @return SplFileInfo |
107 | 107 | */ |
108 | - public function current() |
|
108 | + public function current () |
|
109 | 109 | { |
110 | 110 | /** @var \SplFileInfo $current */ |
111 | 111 | $current = parent::current(); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * {@inheritdoc} |
122 | 122 | */ |
123 | - public function getChildren() |
|
123 | + public function getChildren () |
|
124 | 124 | { |
125 | 125 | return (new self( |
126 | 126 | $this->getInnerIterator()->getChildren(), |
@@ -143,11 +143,17 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function matchesPattern ($filePath) |
145 | 145 | { |
146 | - if ($this->strpos_array($filePath, $this->includes)) { return true; } |
|
147 | - if (($this->flags & self::INCLUDE_ONLY_FILES) && !$this->current()->isDir()) { return false; } |
|
146 | + if ($this->strpos_array($filePath, $this->includes)) |
|
147 | + { |
|
148 | +return true; } |
|
149 | + if (($this->flags & self::INCLUDE_ONLY_FILES) && !$this->current()->isDir()) |
|
150 | + { |
|
151 | +return false; } |
|
148 | 152 | |
149 | 153 | if (!($this->flags & self::ALLOW_DOT_FILES) && |
150 | - preg_match('#(^|\\\\|\/)\..+(\\\\|\/|$)#', $filePath) === 1) { return false; } |
|
154 | + preg_match('#(^|\\\\|\/)\..+(\\\\|\/|$)#', $filePath) === 1) |
|
155 | + { |
|
156 | +return false; } |
|
151 | 157 | |
152 | 158 | return ($this->strpos_array($filePath, $this->excludes) === false); |
153 | 159 | } |
@@ -192,10 +198,13 @@ discard block |
||
192 | 198 | return true; |
193 | 199 | } |
194 | 200 | |
195 | - if (strpos($haystack, $query, $offset) !== false) // stop on first true result |
|
201 | + if (strpos($haystack, $query, $offset) !== false) |
|
202 | + { |
|
203 | + // stop on first true result |
|
196 | 204 | { |
197 | 205 | return true; |
198 | 206 | } |
207 | + } |
|
199 | 208 | } |
200 | 209 | |
201 | 210 | return false; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected $tracking; |
78 | 78 | |
79 | - public function __construct() |
|
79 | + public function __construct () |
|
80 | 80 | { |
81 | 81 | parent::__construct(); |
82 | 82 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param string $filePath |
135 | 135 | * @param string|null $namespace |
136 | 136 | */ |
137 | - public function delArrayFromTracker($key, $filePath, $namespace = null) |
|
137 | + public function delArrayFromTracker ($key, $filePath, $namespace = null) |
|
138 | 138 | { |
139 | 139 | if (is_null($namespace)) |
140 | 140 | { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * @param array $includes |
262 | 262 | * @param array $excludes |
263 | 263 | */ |
264 | - public function scanTrackableItems($path, $options = array(), $includes = array(), $excludes = array()) |
|
264 | + public function scanTrackableItems ($path, $options = array(), $includes = array(), $excludes = array()) |
|
265 | 265 | { |
266 | 266 | $fe = FileExplorer::create($path, $excludes, $includes); |
267 | 267 | $fileExplorer = $fe->getExplorer(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return ContentItem|null |
30 | 30 | */ |
31 | - public function &getContentItem ($filePath) |
|
31 | + public function &getContentItem($filePath) |
|
32 | 32 | { |
33 | 33 | return $this->trackedItemsFlattened[$filePath]; |
34 | 34 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @return ContentItem[][] |
40 | 40 | */ |
41 | - public function &getCollections () |
|
41 | + public function &getCollections() |
|
42 | 42 | { |
43 | 43 | return $this->trackedItems; |
44 | 44 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * {@inheritdoc} |
110 | 110 | */ |
111 | - public function createNewItem($filePath) |
|
111 | + public function createNewItem ($filePath) |
|
112 | 112 | { |
113 | 113 | $collection = $this->getTentativeCollectionName($filePath); |
114 | 114 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * {@inheritdoc} |
122 | 122 | */ |
123 | - public function refreshItem($filePath) |
|
123 | + public function refreshItem ($filePath) |
|
124 | 124 | { |
125 | 125 | return; |
126 | 126 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * {@inheritdoc} |
130 | 130 | */ |
131 | - protected function handleTrackableItem($filePath, $options = array()) |
|
131 | + protected function handleTrackableItem ($filePath, $options = array()) |
|
132 | 132 | { |
133 | 133 | $collectionName = $options['namespace']; |
134 | 134 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * {@inheritdoc} |
42 | 42 | */ |
43 | - public function __construct($filePath) |
|
43 | + public function __construct ($filePath) |
|
44 | 44 | { |
45 | 45 | parent::__construct($filePath); |
46 | 46 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return PageView[] |
88 | 88 | */ |
89 | - public function &getChildren () |
|
89 | + public function &getChildren() |
|
90 | 90 | { |
91 | 91 | return $this->children; |
92 | 92 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | self::$fileSys = new Filesystem(); |
170 | 170 | } |
171 | 171 | |
172 | - $frontMatter = array( |
|
172 | + $frontMatter = array( |
|
173 | 173 | 'permalink' => $redirectFrom, |
174 | 174 | 'redirect' => $redirectTo, |
175 | 175 | 'menu' => false |
@@ -9,7 +9,9 @@ |
||
9 | 9 | foreach ($array as $element) |
10 | 10 | { |
11 | 11 | if (is_array($element)) |
12 | - return true; |
|
12 | + { |
|
13 | + return true; |
|
14 | + } |
|
13 | 15 | } |
14 | 16 | |
15 | 17 | return false; |