@@ -14,6 +14,9 @@ |
||
14 | 14 | $isRegex, |
15 | 15 | $filter; |
16 | 16 | |
17 | + /** |
|
18 | + * @param string $filter |
|
19 | + */ |
|
17 | 20 | public function __construct($filter, \Iterator $iterator) |
18 | 21 | { |
19 | 22 | parent::__construct($iterator); |
@@ -130,7 +130,7 @@ |
||
130 | 130 | ...@@...@@.. |
131 | 131 | ...@@....@@. |
132 | 132 | |
133 | -ASCIIART; |
|
133 | +asciiart; |
|
134 | 134 | |
135 | 135 | $background = 'fg=magenta'; |
136 | 136 | $text = 'fg=white'; |
@@ -102,8 +102,8 @@ |
||
102 | 102 | private function printHeader() |
103 | 103 | { |
104 | 104 | $this->output->writeln(sprintf( |
105 | - '<comment>%s</comment>', |
|
106 | - $this->getLogo() |
|
105 | + '<comment>%s</comment>', |
|
106 | + $this->getLogo() |
|
107 | 107 | )); |
108 | 108 | } |
109 | 109 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | foreach($values as $variable => $value) |
62 | 62 | { |
63 | 63 | $this->output->writeln(sprintf( |
64 | - '<fg=cyan>%s</fg=cyan> = %s', |
|
64 | + '<fg=cyan>%s</fg=cyan> = %s', |
|
65 | 65 | $variable, |
66 | 66 | $this->formatValue($value) |
67 | 67 | )); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function setDefaultEnvironment($environment) |
42 | 42 | { |
43 | - if(! empty($environment) && is_string($environment)) |
|
43 | + if( ! empty($environment) && is_string($environment)) |
|
44 | 44 | { |
45 | 45 | $this->defaultEnvironment = $environment; |
46 | 46 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | private function handleCustomData($value) |
90 | 90 | { |
91 | - if(! is_string($value)) |
|
91 | + if( ! is_string($value)) |
|
92 | 92 | { |
93 | 93 | return $value; |
94 | 94 | } |
@@ -178,7 +178,7 @@ |
||
178 | 178 | |
179 | 179 | private function changeCurrentFile($filePath) |
180 | 180 | { |
181 | - $this->info("Reading $filePath"); |
|
181 | + $this->info("reading $filePath"); |
|
182 | 182 | |
183 | 183 | foreach($this->parsers as $parser) |
184 | 184 | { |
@@ -65,6 +65,9 @@ discard block |
||
65 | 65 | return $this; |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param string $masterFilePath |
|
70 | + */ |
|
68 | 71 | public function parse($masterFilePath) |
69 | 72 | { |
70 | 73 | try |
@@ -182,6 +185,9 @@ discard block |
||
182 | 185 | return $groupName; |
183 | 186 | } |
184 | 187 | |
188 | + /** |
|
189 | + * @param string $groupName |
|
190 | + */ |
|
185 | 191 | private function switchGroupParser($groupName) |
186 | 192 | { |
187 | 193 | if(! isset($this->parsers[$groupName])) |
@@ -221,9 +221,9 @@ |
||
221 | 221 | foreach($files as $file => $status) |
222 | 222 | { |
223 | 223 | $message = sprintf( |
224 | - 'External file %s was %s', |
|
225 | - $file, |
|
226 | - $status['found'] ? 'found' : '<options=bold>not found</options=bold>' |
|
224 | + 'External file %s was %s', |
|
225 | + $file, |
|
226 | + $status['found'] ? 'found' : '<options=bold>not found</options=bold>' |
|
227 | 227 | ); |
228 | 228 | |
229 | 229 | $this->warning($message); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | public function enableIncludeSupport() |
49 | 49 | { |
50 | - if(! isset($this->parsers[self::INCLUDES])) |
|
50 | + if( ! isset($this->parsers[self::INCLUDES])) |
|
51 | 51 | { |
52 | 52 | $this->parsers[self::INCLUDES] = new IncludeParser(); |
53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function enableExternalSupport() |
59 | 59 | { |
60 | - if(! isset($this->parsers[self::EXTERNALS])) |
|
60 | + if( ! isset($this->parsers[self::EXTERNALS])) |
|
61 | 61 | { |
62 | 62 | $this->parsers[self::EXTERNALS] = new ExternalParser(new Parser($this->fs)); |
63 | 63 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | $files = array($masterFilePath); |
89 | 89 | |
90 | - while(! empty($files)) |
|
90 | + while( ! empty($files)) |
|
91 | 91 | { |
92 | 92 | foreach($files as $file) |
93 | 93 | { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | private function extractLines($filePath) |
135 | 135 | { |
136 | - if(! $this->fs->has($filePath)) |
|
136 | + if( ! $this->fs->has($filePath)) |
|
137 | 137 | { |
138 | 138 | throw new \RuntimeException("$filePath does not exist"); |
139 | 139 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | private function switchGroupParser($groupName) |
186 | 186 | { |
187 | - if(! isset($this->parsers[$groupName])) |
|
187 | + if( ! isset($this->parsers[$groupName])) |
|
188 | 188 | { |
189 | 189 | throw new \RuntimeException('Unknown group name ' . $groupName); |
190 | 190 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | private function checkFilenameIsValid($filename) |
28 | 28 | { |
29 | - if(! preg_match('~.*\.conf$~', $filename)) |
|
29 | + if( ! preg_match('~.*\.conf$~', $filename)) |
|
30 | 30 | { |
31 | 31 | $this->triggerError("$filename is not a valid file name", 'Invalid dependency'); |
32 | 32 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->info(sprintf( |
102 | - '%d files generated', |
|
102 | + '%d files generated', |
|
103 | 103 | count($distFiles) |
104 | 104 | )); |
105 | 105 | } |
@@ -101,6 +101,11 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | + /** |
|
105 | + * @param string|boolean $content |
|
106 | + * |
|
107 | + * @return string |
|
108 | + */ |
|
104 | 109 | private function injectValues($sourceFile, $content, $environment) |
105 | 110 | { |
106 | 111 | $formatter = $this->formatterProvider->getFormatter(); |
@@ -118,6 +123,9 @@ discard block |
||
118 | 123 | return $targetContent; |
119 | 124 | } |
120 | 125 | |
126 | + /** |
|
127 | + * @param string $targetFile |
|
128 | + */ |
|
121 | 129 | private function backupFile($targetFile) |
122 | 130 | { |
123 | 131 | if($this->enableBackup === true) |
@@ -92,7 +92,7 @@ |
||
92 | 92 | $targetContent = $this->injectValues($file, $content, $environment); |
93 | 93 | |
94 | 94 | $targetFile = substr($file, 0, strlen($this->suffix) * -1); |
95 | - $this->debug("Write $targetFile"); |
|
95 | + $this->debug("write $targetFile"); |
|
96 | 96 | |
97 | 97 | if($this->dryRun === false) |
98 | 98 | { |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | private function injectValues($sourceFile, $content, $environment) |
90 | 90 | { |
91 | - $targetContent = preg_replace_callback('~<%(?P<variableName>[A-Za-z0-9_\.]+)%>~', function(array $matches) use($environment){ |
|
91 | + $targetContent = preg_replace_callback('~<%(?P<variableName>[A-Za-z0-9_\.]+)%>~', function(array $matches) use($environment) { |
|
92 | 92 | return $this->reader->read($matches['variableName'], $environment); |
93 | 93 | }, $content, -1, $count); |
94 | 94 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | if($verbosity <= $this->output->getVerbosity()) |
44 | 44 | { |
45 | - if(! is_array($messages)) |
|
45 | + if( ! is_array($messages)) |
|
46 | 46 | { |
47 | 47 | $messages = array($messages); |
48 | 48 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | private function writeLevel($level) |
51 | 51 | { |
52 | 52 | $message = str_pad(sprintf( |
53 | - '[%s]', |
|
54 | - strtoupper($level) |
|
53 | + '[%s]', |
|
54 | + strtoupper($level) |
|
55 | 55 | ), 10); |
56 | 56 | |
57 | 57 | $this->output->write($this->colorizeMessage($level, $message)); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if(isset($colors[$level])) |
68 | 68 | { |
69 | 69 | $message = sprintf( |
70 | - '<%1$s>%2$s</%1$s>', |
|
70 | + '<%1$s>%2$s</%1$s>', |
|
71 | 71 | 'fg=' . $colors[$level], |
72 | 72 | $message |
73 | 73 | ); |