@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | protected function createDefinition( |
| 36 | 36 | mixed $value, |
| 37 | 37 | array $parameters = [] |
| 38 | - ): Value|Alias|Factory { |
|
| 38 | + ): Value | Alias | Factory { |
|
| 39 | 39 | if (is_callable($value)) { |
| 40 | 40 | return new Factory($value, $parameters); |
| 41 | 41 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return Value|Alias |
| 54 | 54 | */ |
| 55 | - protected function createValueDefinition(mixed $value): Value|Alias |
|
| 55 | + protected function createValueDefinition(mixed $value): Value | Alias |
|
| 56 | 56 | { |
| 57 | 57 | if (is_string($value) && str_contains($value, '@')) { |
| 58 | 58 | return new Alias($value); |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | $directory = new RecursiveDirectoryIterator($directory); |
| 55 | 55 | } catch (\Exception $caught) { |
| 56 | 56 | throw new InvalidDefinitionsPathException( |
| 57 | - 'Provided definitions path is not valid or is not found. ' . |
|
| 58 | - 'Could not create container. Please check ' . $directory |
|
| 57 | + 'Provided definitions path is not valid or is not found. '. |
|
| 58 | + 'Could not create container. Please check '.$directory |
|
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $phpFiles = new \RegexIterator($iterator, '/.*\.php$/i'); |
| 64 | 64 | |
| 65 | 65 | foreach ($phpFiles as $phpFile) { |
| 66 | - $definitions = (array)(new FileDefinitionLoader($phpFile))->getIterator(); |
|
| 66 | + $definitions = (array) (new FileDefinitionLoader($phpFile))->getIterator(); |
|
| 67 | 67 | $this->definitions = array_merge($this->definitions, $definitions); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | preg_match($namespaceRegEx, $this->content, $found); |
| 107 | 107 | |
| 108 | 108 | $this->namespace = trim($found['namespace']); |
| 109 | - $this->className = $this->namespace . "\\" . trim($matches['name']) ?? null; |
|
| 109 | + $this->className = $this->namespace."\\".trim($matches['name']) ?? null; |
|
| 110 | 110 | |
| 111 | 111 | $interfaces = $this->clearNames($matches['interfaces'] ? explode(',', $matches['interfaces']) : []); |
| 112 | 112 | $parentClass = $matches['parent'] ?? null; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $interfaces[] = str_starts_with($interfaceName, "\\") |
| 173 | 173 | ? $interfaceName |
| 174 | - : $this->namespace . "\\" . $interfaceName; |
|
| 174 | + : $this->namespace."\\".$interfaceName; |
|
| 175 | 175 | } |
| 176 | 176 | return $interfaces; |
| 177 | 177 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | return str_starts_with(trim($parentClass), "\\") |
| 196 | 196 | ? trim($parentClass) |
| 197 | - : $this->namespace . "\\" . trim($parentClass); |
|
| 197 | + : $this->namespace."\\".trim($parentClass); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * @var array|string |
| 28 | 28 | */ |
| 29 | - private string|array $definitions = []; |
|
| 29 | + private string | array $definitions = []; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @throws Exception |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | public function register( |
| 113 | 113 | string $name, |
| 114 | 114 | mixed $definition = null, |
| 115 | - string|Scope $scope = Scope::SINGLETON, |
|
| 115 | + string | Scope $scope = Scope::SINGLETON, |
|
| 116 | 116 | array $parameters = [] |
| 117 | 117 | ): Container { |
| 118 | 118 | if ($definition instanceof DefinitionInterface) { |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | try { |
| 57 | 57 | $this->directoryWatcher = new Directory($path); |
| 58 | - } catch (DirectoryNotFound|DirectoryNotAccecible) { |
|
| 58 | + } catch (DirectoryNotFound | DirectoryNotAccecible) { |
|
| 59 | 59 | throw new InvalidDefinitionsPathException( |
| 60 | - 'Provided autowire definitions path is not valid or is not found. ' . |
|
| 61 | - 'Could not create container. Please check ' . $path |
|
| 60 | + 'Provided autowire definitions path is not valid or is not found. '. |
|
| 61 | + 'Could not create container. Please check '.$path |
|
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | $directory = new RecursiveDirectoryIterator($path); |
| 96 | 96 | } catch (Exception) { |
| 97 | 97 | throw new InvalidDefinitionsPathException( |
| 98 | - 'Provided autowire definitions path is not valid or is not found. ' . |
|
| 99 | - 'Could not create container. Please check ' . $path |
|
| 98 | + 'Provided autowire definitions path is not valid or is not found. '. |
|
| 99 | + 'Could not create container. Please check '.$path |
|
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | private function saveImplementations(): void |
| 149 | 149 | { |
| 150 | - $file = sys_get_temp_dir() . self::TMP_FILE_NAME; |
|
| 150 | + $file = sys_get_temp_dir().self::TMP_FILE_NAME; |
|
| 151 | 151 | if (is_file($file)) { |
| 152 | 152 | unlink($file); |
| 153 | 153 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | private function loadImplementations(): bool |
| 162 | 162 | { |
| 163 | - $file = sys_get_temp_dir() . self::TMP_FILE_NAME; |
|
| 163 | + $file = sys_get_temp_dir().self::TMP_FILE_NAME; |
|
| 164 | 164 | if (!file_exists($file)) { |
| 165 | 165 | return false; |
| 166 | 166 | } |
@@ -191,15 +191,15 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | private function createCallback(string $className): callable |
| 193 | 193 | { |
| 194 | - return function (Container $container) use ($className) { |
|
| 194 | + return function(Container $container) use ($className) { |
|
| 195 | 195 | return $container->make($className); |
| 196 | 196 | }; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | private function createAmbiguousCallback(string $interface): callable |
| 200 | 200 | { |
| 201 | - return function () use ($interface) { |
|
| 202 | - throw new AmbiguousImplementationException("Ambiguous implementation for '$interface'. " . |
|
| 201 | + return function() use ($interface) { |
|
| 202 | + throw new AmbiguousImplementationException("Ambiguous implementation for '$interface'. ". |
|
| 203 | 203 | "There are more then 1 implementations you need to provide a service definition for this interface."); |
| 204 | 204 | }; |
| 205 | 205 | } |