@@ -304,12 +304,12 @@ discard block |
||
304 | 304 | if (isset($parameterConfiguration['default'])) { |
305 | 305 | $value = (string) $parameterConfiguration['default']; |
306 | 306 | if ($type === 'string') { |
307 | - $value = "'" . addslashes($value) . "'"; |
|
307 | + $value = "'".addslashes($value)."'"; |
|
308 | 308 | } |
309 | 309 | } |
310 | 310 | |
311 | 311 | if (isset($parameterConfiguration['required'])) { |
312 | - if ((bool)$parameterConfiguration['required']) { |
|
312 | + if ((bool) $parameterConfiguration['required']) { |
|
313 | 313 | $value = null; |
314 | 314 | } else { |
315 | 315 | $value = $value ?? 'null'; |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | $classParts = explode('/', $classPath); |
329 | 329 | $className = array_pop($classParts); |
330 | 330 | $namespace = implode('\\', $classParts); |
331 | - $namespace = $this->namespace . ($namespace === '' ? '' : $namespace); |
|
331 | + $namespace = $this->namespace.($namespace === '' ? '' : $namespace); |
|
332 | 332 | |
333 | 333 | return [ |
334 | 334 | $namespace, |
335 | - $classPrefix . $className . $classSuffix, |
|
335 | + $classPrefix.$className.$classSuffix, |
|
336 | 336 | ]; |
337 | 337 | } |
338 | 338 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | if (preg_match('$^#/definitions/$', $type)) { |
345 | 345 | $className = preg_replace('$#/definitions/$', '', $type); |
346 | 346 | $className = $this->helper::camelize($className); |
347 | - return '\\' . $this->modelNamespace . '\\' . $className; |
|
347 | + return '\\'.$this->modelNamespace.'\\'.$className; |
|
348 | 348 | } |
349 | 349 | |
350 | 350 | return $type; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | { |
358 | 358 | $filePath = sprintf('%s/%s%s%s.php', $this->folder, $classPrefix, $this->helper::getClassPathFromPath($path), $classSuffix); |
359 | 359 | |
360 | - return preg_replace('#/' . $classPrefix . $classSuffix . '\.php$#', $classPrefix . $classSuffix . '.php', $filePath); |
|
360 | + return preg_replace('#/'.$classPrefix.$classSuffix.'\.php$#', $classPrefix.$classSuffix.'.php', $filePath); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -81,14 +81,14 @@ |
||
81 | 81 | { |
82 | 82 | $content = ''; |
83 | 83 | |
84 | - $content .= '<?php' . "\n"; |
|
84 | + $content .= '<?php'."\n"; |
|
85 | 85 | $content .= "\n"; |
86 | 86 | $content .= 'declare(strict_types=1);'."\n"; |
87 | 87 | $content .= "\n"; |
88 | 88 | $content .= 'namespace '.$this->namespace.';'."\n"; |
89 | 89 | $content .= "\n"; |
90 | 90 | $content .= $this->usesGenerator->generate($indent); |
91 | - $content .= $this->buildClassSignature() . "\n"; |
|
91 | + $content .= $this->buildClassSignature()."\n"; |
|
92 | 92 | $content .= '{'; |
93 | 93 | if (null !== $this->traitsGenerator) { |
94 | 94 | $content .= $this->traitsGenerator->generate($indent); |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | |
107 | 107 | $format = ''; |
108 | 108 | if (preg_match('#^\?#', $methodParameterGenerator->getPhpType())) { |
109 | - $format .= 'if (null === $this->%2$s) {' . "\n"; |
|
110 | - $format .= '%4$sreturn false;' . "\n"; |
|
111 | - $format .= '}' . "\n\n"; |
|
109 | + $format .= 'if (null === $this->%2$s) {'."\n"; |
|
110 | + $format .= '%4$sreturn false;'."\n"; |
|
111 | + $format .= '}'."\n\n"; |
|
112 | 112 | } |
113 | 113 | $format .= 'return in_array($%1$s, $this->%2$s, %3$s);'; |
114 | 114 | |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | ); |
142 | 142 | $this->addSetterMethod->addParameter($methodParameterGenerator); |
143 | 143 | |
144 | - $format = 'if ($this->%1$s(%2$s)) {' . "\n"; |
|
145 | - $format .= '%3$sreturn;' . "\n"; |
|
146 | - $format .= '}' . "\n\n"; |
|
144 | + $format = 'if ($this->%1$s(%2$s)) {'."\n"; |
|
145 | + $format .= '%3$sreturn;'."\n"; |
|
146 | + $format .= '}'."\n\n"; |
|
147 | 147 | if (preg_match('#^\?#', $methodParameterGenerator->getPhpType())) { |
148 | - $format .= 'if (null === $this->%4$s) {' . "\n"; |
|
149 | - $format .= '%3$s$this->%4$s = [];' . "\n"; |
|
150 | - $format .= '}' . "\n\n"; |
|
148 | + $format .= 'if (null === $this->%4$s) {'."\n"; |
|
149 | + $format .= '%3$s$this->%4$s = [];'."\n"; |
|
150 | + $format .= '}'."\n\n"; |
|
151 | 151 | } |
152 | 152 | $format .= '$this->%4$s[] = %2$s;'; |
153 | 153 | |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | |
181 | 181 | $this->removeSetterMethod->addParameter($methodParameterGenerator); |
182 | 182 | |
183 | - $format = 'if ($this->%1$s(%2$s)) {' . "\n"; |
|
184 | - $format .= '%3$s$index = array_search(%2$s, $this->%4$s);' . "\n"; |
|
185 | - $format .= '%3$sunset($this->%4$s[$index]);' . "\n"; |
|
183 | + $format = 'if ($this->%1$s(%2$s)) {'."\n"; |
|
184 | + $format .= '%3$s$index = array_search(%2$s, $this->%4$s);'."\n"; |
|
185 | + $format .= '%3$sunset($this->%4$s[$index]);'."\n"; |
|
186 | 186 | $format .= '}'; |
187 | 187 | |
188 | 188 | $this->removeSetterMethod->addLine( |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $content = ''; |
101 | 101 | foreach ($this->lines as $line) { |
102 | 102 | foreach (explode("\n", $line) as $innerLine) { |
103 | - $content .= $indent.$indent.$innerLine. "\n"; |
|
103 | + $content .= $indent.$indent.$innerLine."\n"; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | return $content; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $methodParameters = $this->buildMethodParameters($indent, '%1$s'); |
118 | 118 | // 3 = length of $formatVar - 1 (see line just below) |
119 | 119 | // -1 because the first parameter don't have $formatVar |
120 | - $methodParametersLength = strlen($methodParameters) - 3*(count($this->parameters)-1); |
|
120 | + $methodParametersLength = strlen($methodParameters)-3 * (count($this->parameters)-1); |
|
121 | 121 | $parametersFutureFormat = '%s%s%s'; |
122 | 122 | $content = sprintf('%s%s%s function %s (%s)%s', |
123 | 123 | $indent, |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $parametersStart = ''; |
132 | 132 | $additionalIndentation = ' '; |
133 | 133 | $parametersEnd = ''; |
134 | - $contentLength = strlen($content) - strlen($parametersFutureFormat) + $methodParametersLength; |
|
134 | + $contentLength = strlen($content)-strlen($parametersFutureFormat)+$methodParametersLength; |
|
135 | 135 | if ($contentLength > $this->phpDocGenerator->getWrapOn()) { |
136 | 136 | // Make parameters go into multiline formation |
137 | 137 | $additionalIndentation = "\n".$indent.$indent; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return ''; |
174 | 174 | } |
175 | 175 | |
176 | - return sprintf (': %s', $this->getPhpReturnType()); |
|
176 | + return sprintf(': %s', $this->getPhpReturnType()); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |