@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $this->setCurrentDir(\dirname($path)); |
| 34 | 34 | $this->container->fileExists($path); |
| 35 | 35 | // the closure forbids access to the private scope in the included file |
| 36 | - $load = \Closure::bind(function ($path) use($container, $loader, $resource, $type) { |
|
| 36 | + $load = \Closure::bind(function($path) use($container, $loader, $resource, $type) { |
|
| 37 | 37 | return include $path; |
| 38 | 38 | }, $this, ProtectedPhpFileLoader::class); |
| 39 | 39 | $callback = $load($path); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function supports($resource, $type = null) |
| 48 | 48 | { |
| 49 | - if (!\is_string($resource)) { |
|
| 49 | + if ( ! \is_string($resource)) { |
|
| 50 | 50 | return \false; |
| 51 | 51 | } |
| 52 | 52 | if (null === $type && 'php' === \pathinfo($resource, \PATHINFO_EXTENSION)) { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | { |
| 53 | 53 | parent::__destruct(); |
| 54 | 54 | $this->container->removeBindings($this->id); |
| 55 | - if (!$this->definition instanceof ChildDefinition) { |
|
| 55 | + if ( ! $this->definition instanceof ChildDefinition) { |
|
| 56 | 56 | $this->container->setDefinition($this->id, $this->definition->setInstanceofConditionals($this->instanceof)); |
| 57 | 57 | } else { |
| 58 | 58 | $this->container->setDefinition($this->id, $this->definition); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $this->defaults = new Definition(); |
| 34 | 34 | $this->container = $container; |
| 35 | 35 | $this->loader = $loader; |
| 36 | - $this->instanceof =& $instanceof; |
|
| 36 | + $this->instanceof = & $instanceof; |
|
| 37 | 37 | $instanceof = []; |
| 38 | 38 | } |
| 39 | 39 | /** |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | public final function set($id, $class = null) |
| 69 | 69 | { |
| 70 | 70 | $defaults = $this->defaults; |
| 71 | - $allowParent = !$defaults->getChanges() && empty($this->instanceof); |
|
| 71 | + $allowParent = ! $defaults->getChanges() && empty($this->instanceof); |
|
| 72 | 72 | $definition = new Definition(); |
| 73 | - if (!$defaults->isPublic() || !$defaults->isPrivate()) { |
|
| 74 | - $definition->setPublic($defaults->isPublic() && !$defaults->isPrivate()); |
|
| 73 | + if ( ! $defaults->isPublic() || ! $defaults->isPrivate()) { |
|
| 74 | + $definition->setPublic($defaults->isPublic() && ! $defaults->isPrivate()); |
|
| 75 | 75 | } |
| 76 | 76 | $definition->setAutowired($defaults->isAutowired()); |
| 77 | 77 | $definition->setAutoconfigured($defaults->isAutoconfigured()); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $ref = static::processValue($referencedId, \true); |
| 95 | 95 | $alias = new Alias((string) $ref); |
| 96 | - if (!$this->defaults->isPublic() || !$this->defaults->isPrivate()) { |
|
| 96 | + if ( ! $this->defaults->isPublic() || ! $this->defaults->isPrivate()) { |
|
| 97 | 97 | $alias->setPublic($this->defaults->isPublic()); |
| 98 | 98 | } |
| 99 | 99 | $this->container->setAlias($id, $alias); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public final function load($namespace, $resource) |
| 111 | 111 | { |
| 112 | - $allowParent = !$this->defaults->getChanges() && empty($this->instanceof); |
|
| 112 | + $allowParent = ! $this->defaults->getChanges() && empty($this->instanceof); |
|
| 113 | 113 | return new PrototypeConfigurator($this, $this->loader, $this->defaults, $namespace, $resource, $allowParent); |
| 114 | 114 | } |
| 115 | 115 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public final function get($id) |
| 125 | 125 | { |
| 126 | - $allowParent = !$this->defaults->getChanges() && empty($this->instanceof); |
|
| 126 | + $allowParent = ! $this->defaults->getChanges() && empty($this->instanceof); |
|
| 127 | 127 | $definition = $this->container->getDefinition($id); |
| 128 | 128 | return new ServiceConfigurator($this->container, $definition->getInstanceofConditionals(), $allowParent, $this, $definition, $id, []); |
| 129 | 129 | } |
@@ -32,14 +32,14 @@ |
||
| 32 | 32 | { |
| 33 | 33 | $this->container = $container; |
| 34 | 34 | $this->loader = $loader; |
| 35 | - $this->instanceof =& $instanceof; |
|
| 35 | + $this->instanceof = & $instanceof; |
|
| 36 | 36 | $this->path = $path; |
| 37 | 37 | $this->file = $file; |
| 38 | 38 | } |
| 39 | 39 | public final function extension($namespace, array $config) |
| 40 | 40 | { |
| 41 | - if (!$this->container->hasExtension($namespace)) { |
|
| 42 | - $extensions = \array_filter(\array_map(function ($ext) { |
|
| 41 | + if ( ! $this->container->hasExtension($namespace)) { |
|
| 42 | + $extensions = \array_filter(\array_map(function($ext) { |
|
| 43 | 43 | return $ext->getAlias(); |
| 44 | 44 | }, $this->container->getExtensions())); |
| 45 | 45 | throw new InvalidArgumentException(\sprintf('There is no extension able to load the configuration for "%s" (in "%s"). Looked for namespace "%s", found "%s".', $namespace, $this->file, $namespace, $extensions ? \implode('", "', $extensions) : 'none')); |
@@ -35,11 +35,11 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public final function tag($name, array $attributes = []) |
| 37 | 37 | { |
| 38 | - if (!\is_string($name) || '' === $name) { |
|
| 38 | + if ( ! \is_string($name) || '' === $name) { |
|
| 39 | 39 | throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.'); |
| 40 | 40 | } |
| 41 | 41 | foreach ($attributes as $attribute => $value) { |
| 42 | - if (!\is_scalar($value) && null !== $value) { |
|
| 42 | + if ( ! \is_scalar($value) && null !== $value) { |
|
| 43 | 43 | throw new InvalidArgumentException(\sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute)); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | public function __construct(ServicesConfigurator $parent, PhpFileLoader $loader, Definition $defaults, $namespace, $resource, $allowParent) |
| 41 | 41 | { |
| 42 | 42 | $definition = new Definition(); |
| 43 | - if (!$defaults->isPublic() || !$defaults->isPrivate()) { |
|
| 43 | + if ( ! $defaults->isPublic() || ! $defaults->isPrivate()) { |
|
| 44 | 44 | $definition->setPublic($defaults->isPublic()); |
| 45 | 45 | } |
| 46 | 46 | $definition->setAutowired($defaults->isAutowired()); |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public final function tag($name, array $attributes = []) |
| 25 | 25 | { |
| 26 | - if (!\is_string($name) || '' === $name) { |
|
| 26 | + if ( ! \is_string($name) || '' === $name) { |
|
| 27 | 27 | throw new InvalidArgumentException(\sprintf('The tag name for service "%s" must be a non-empty string.', $this->id)); |
| 28 | 28 | } |
| 29 | 29 | foreach ($attributes as $attribute => $value) { |
| 30 | - if (!\is_scalar($value) && null !== $value) { |
|
| 30 | + if ( ! \is_scalar($value) && null !== $value) { |
|
| 31 | 31 | throw new InvalidArgumentException(\sprintf('A tag attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $this->id, $name, $attribute)); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | public final function bind($nameOrFqcn, $valueOrRef) |
| 30 | 30 | { |
| 31 | 31 | $valueOrRef = static::processValue($valueOrRef, \true); |
| 32 | - if (isset($nameOrFqcn[0]) && '$' !== $nameOrFqcn[0] && !$valueOrRef instanceof Reference) { |
|
| 32 | + if (isset($nameOrFqcn[0]) && '$' !== $nameOrFqcn[0] && ! $valueOrRef instanceof Reference) { |
|
| 33 | 33 | throw new InvalidArgumentException(\sprintf('Invalid binding for service "%s": named arguments must start with a "$", and FQCN must map to references. Neither applies to binding "%s".', $this->id, $nameOrFqcn)); |
| 34 | 34 | } |
| 35 | 35 | $bindings = $this->definition->getBindings(); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | protected final function setParent($parent) |
| 30 | 30 | { |
| 31 | - if (!$this->allowParent) { |
|
| 31 | + if ( ! $this->allowParent) { |
|
| 32 | 32 | throw new InvalidArgumentException(\sprintf('A parent cannot be defined when either "_instanceof" or "_defaults" are also defined for service prototype "%s".', $this->id)); |
| 33 | 33 | } |
| 34 | 34 | if ($this->definition instanceof ChildDefinition) { |