@@ -23,10 +23,10 @@ |
||
| 23 | 23 | |
| 24 | 24 | $numbers = ''; |
| 25 | 25 | while (true) { |
| 26 | - $lastCharacter = substr($variable, strlen($variable) - 1); |
|
| 26 | + $lastCharacter = substr($variable, strlen($variable)-1); |
|
| 27 | 27 | if ($lastCharacter >= '0' && $lastCharacter <= '9') { |
| 28 | 28 | $numbers = $lastCharacter.$numbers; |
| 29 | - $variable = substr($variable, 0, strlen($variable) - 1); |
|
| 29 | + $variable = substr($variable, 0, strlen($variable)-1); |
|
| 30 | 30 | } else { |
| 31 | 31 | break; |
| 32 | 32 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $convertedDefinitions[$identifier] = $this->converter->convert($identifier, $definition); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $allDefinitions = $convertedDefinitions + $this->dumpableDefinitions; |
|
| 180 | + $allDefinitions = $convertedDefinitions+$this->dumpableDefinitions; |
|
| 181 | 181 | |
| 182 | 182 | foreach ($allDefinitions as $identifier => $definition) { |
| 183 | 183 | $inlineEntry = $definition->toPhpCode('$container', ['$container']); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | $pos = strrpos($className, '\\'); |
| 198 | 198 | if ($pos !== false) { |
| 199 | - $shortClassName = substr($className, $pos + 1); |
|
| 199 | + $shortClassName = substr($className, $pos+1); |
|
| 200 | 200 | $namespaceLine = 'namespace '.substr($className, 0, $pos).';'; |
| 201 | 201 | } else { |
| 202 | 202 | $shortClassName = $className; |
@@ -28,6 +28,9 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $containerVariable |
|
| 33 | + */ |
|
| 31 | 34 | public static function dumpArguments($argumentsValues, $containerVariable, array $usedVariables): InlineEntryInterface |
| 32 | 35 | { |
| 33 | 36 | $arguments = []; |
@@ -46,6 +49,9 @@ discard block |
||
| 46 | 49 | return new InlineEntry($argumentsCode, $prependedCodeString, $usedVariables); |
| 47 | 50 | } |
| 48 | 51 | |
| 52 | + /** |
|
| 53 | + * @param string $containerVariable |
|
| 54 | + */ |
|
| 49 | 55 | private static function dumpArray(array $value, $containerVariable, array $usedVariables): InlineEntryInterface |
| 50 | 56 | { |
| 51 | 57 | $code = array(); |
@@ -64,6 +70,9 @@ discard block |
||
| 64 | 70 | return new InlineEntry(sprintf('array(%s)', implode(', ', $code)), implode("\n", $prependCode), $usedVariables); |
| 65 | 71 | } |
| 66 | 72 | |
| 73 | + /** |
|
| 74 | + * @param string $containerVariable |
|
| 75 | + */ |
|
| 67 | 76 | private static function dumpDefinition(DumpableInterface $definition, $containerVariable, array $usedVariables): InlineEntryInterface |
| 68 | 77 | { |
| 69 | 78 | // If the identifier is null, we must inline the definition. |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | /** |
| 23 | 23 | * @param string|null $identifier |
| 24 | - * @param DefinitionInterface|mixed $definition |
|
| 24 | + * @param DefinitionInterface $definition |
|
| 25 | 25 | * |
| 26 | 26 | * @return AliasDefinition|FactoryCallDefinition|ObjectDefinition|ParameterDefinition|Reference |
| 27 | 27 | */ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace TheCodingMachine\Yaco\ServiceProvider; |
| 6 | 6 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } elseif (is_string($callable) && strpos($callable, '::') !== false) { |
| 164 | 164 | $pos = strpos($callable, '::'); |
| 165 | 165 | $className = substr($callable, 0, $pos); |
| 166 | - $methodName = substr($callable, $pos + 2); |
|
| 166 | + $methodName = substr($callable, $pos+2); |
|
| 167 | 167 | |
| 168 | 168 | return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition]); |
| 169 | 169 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | } elseif (is_string($callable) && strpos($callable, '::') !== false) { |
| 194 | 194 | $pos = strpos($callable, '::'); |
| 195 | 195 | $className = substr($callable, 0, $pos); |
| 196 | - $methodName = substr($callable, $pos + 2); |
|
| 196 | + $methodName = substr($callable, $pos+2); |
|
| 197 | 197 | |
| 198 | 198 | return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition, $previousDefinition]); |
| 199 | 199 | } |