@@ -52,7 +52,7 @@ |
||
52 | 52 | $id = $node->getId(); |
53 | 53 | if (empty($this->checkedNodes[$id])) { |
54 | 54 | // Don't check circular references for lazy edges |
55 | - if (!$node->getValue() || !$edge->isLazy() && !$edge->isWeak()) { |
|
55 | + if ( ! $node->getValue() || ! $edge->isLazy() && ! $edge->isWeak()) { |
|
56 | 56 | $searchKey = \array_search($id, $this->currentPath); |
57 | 57 | $this->currentPath[] = $id; |
58 | 58 | if (\false !== $searchKey) { |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | namespace Wordlift\Modules\Common\Symfony\Component\DependencyInjection\Compiler; |
12 | 12 | |
13 | -@\trigger_error('The ' . __NAMESPACE__ . '\\AutowireExceptionPass class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the DefinitionErrorExceptionPass class instead.', \E_USER_DEPRECATED); |
|
13 | +@\trigger_error('The '.__NAMESPACE__.'\\AutowireExceptionPass class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the DefinitionErrorExceptionPass class instead.', \E_USER_DEPRECATED); |
|
14 | 14 | use Wordlift\Modules\Common\Symfony\Component\DependencyInjection\ContainerBuilder; |
15 | 15 | /** |
16 | 16 | * Throws autowire exceptions from AutowirePass for definitions that still exist. |
@@ -22,10 +22,10 @@ |
||
22 | 22 | { |
23 | 23 | protected function processValue($value, $isRoot = \false) |
24 | 24 | { |
25 | - if (!$value instanceof Reference) { |
|
25 | + if ( ! $value instanceof Reference) { |
|
26 | 26 | return parent::processValue($value, $isRoot); |
27 | 27 | } |
28 | - if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior() && !$this->container->has($id = (string) $value)) { |
|
28 | + if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior() && ! $this->container->has($id = (string) $value)) { |
|
29 | 29 | throw new ServiceNotFoundException($id, $this->currentId); |
30 | 30 | } |
31 | 31 | return $value; |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | $types = []; |
33 | 33 | $processors = []; |
34 | 34 | foreach ($container->findTaggedServiceIds('container.env_var_processor') as $id => $tags) { |
35 | - if (!($r = $container->getReflectionClass($class = $container->getDefinition($id)->getClass()))) { |
|
35 | + if ( ! ($r = $container->getReflectionClass($class = $container->getDefinition($id)->getClass()))) { |
|
36 | 36 | throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); |
37 | - } elseif (!$r->isSubclassOf(EnvVarProcessorInterface::class)) { |
|
37 | + } elseif ( ! $r->isSubclassOf(EnvVarProcessorInterface::class)) { |
|
38 | 38 | throw new InvalidArgumentException(\sprintf('Service "%s" must implement interface "%s".', $id, EnvVarProcessorInterface::class)); |
39 | 39 | } |
40 | 40 | foreach ($class::getProvidedTypes() as $prefix => $type) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | if ($bag instanceof EnvPlaceholderParameterBag) { |
46 | 46 | foreach (EnvVarProcessor::getProvidedTypes() as $prefix => $type) { |
47 | - if (!isset($types[$prefix])) { |
|
47 | + if ( ! isset($types[$prefix])) { |
|
48 | 48 | $types[$prefix] = self::validateProvidedTypes($type, EnvVarProcessor::class); |
49 | 49 | } |
50 | 50 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $types = \explode('|', $types); |
60 | 60 | foreach ($types as $type) { |
61 | - if (!\in_array($type, self::$allowedTypes)) { |
|
61 | + if ( ! \in_array($type, self::$allowedTypes)) { |
|
62 | 62 | throw new InvalidArgumentException(\sprintf('Invalid type "%s" returned by "%s::getProvidedTypes()", expected one of "%s".', $type, $class, \implode('", "', self::$allowedTypes))); |
63 | 63 | } |
64 | 64 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $v = null; |
64 | 64 | $this->container->getDefinition($this->currentId)->addError($e->getMessage()); |
65 | 65 | } |
66 | - return $this->resolveArrays || !$v || !\is_array($v) ? $v : $value; |
|
66 | + return $this->resolveArrays || ! $v || ! \is_array($v) ? $v : $value; |
|
67 | 67 | } |
68 | 68 | if ($value instanceof Definition) { |
69 | 69 | $value->setBindings($this->processValue($value->getBindings())); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function __construct(array $passes) |
33 | 33 | { |
34 | 34 | foreach ($passes as $pass) { |
35 | - if (!$pass instanceof RepeatablePassInterface) { |
|
35 | + if ( ! $pass instanceof RepeatablePassInterface) { |
|
36 | 36 | throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.'); |
37 | 37 | } |
38 | 38 | $pass->setRepeatedPass($this); |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | protected function processValue($value, $isRoot = \false) |
25 | 25 | { |
26 | 26 | $value = parent::processValue($value, $isRoot); |
27 | - if (!$value instanceof Definition || !$value->isAutowired() || $value->isAbstract() || !$value->getClass()) { |
|
27 | + if ( ! $value instanceof Definition || ! $value->isAutowired() || $value->isAbstract() || ! $value->getClass()) { |
|
28 | 28 | return $value; |
29 | 29 | } |
30 | - if (!($reflectionClass = $this->container->getReflectionClass($value->getClass(), \false))) { |
|
30 | + if ( ! ($reflectionClass = $this->container->getReflectionClass($value->getClass(), \false))) { |
|
31 | 31 | return $value; |
32 | 32 | } |
33 | 33 | $alreadyCalledMethods = []; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $value->addMethodCall($reflectionMethod->name); |
46 | 46 | break; |
47 | 47 | } |
48 | - if (\false === \stripos($doc, '@inheritdoc') || !\preg_match('#(?:^/\\*\\*|\\n\\s*+\\*)\\s*+(?:\\{@inheritdoc\\}|@inheritdoc)(?:\\s|\\*/$)#i', $doc)) { |
|
48 | + if (\false === \stripos($doc, '@inheritdoc') || ! \preg_match('#(?:^/\\*\\*|\\n\\s*+\\*)\\s*+(?:\\{@inheritdoc\\}|@inheritdoc)(?:\\s|\\*/$)#i', $doc)) { |
|
49 | 49 | break; |
50 | 50 | } |
51 | 51 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | continue; |
30 | 30 | } |
31 | 31 | if (\preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+(?:\\\\[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*+)++$/', $id)) { |
32 | - if ($definition instanceof ChildDefinition && !\class_exists($id)) { |
|
32 | + if ($definition instanceof ChildDefinition && ! \class_exists($id)) { |
|
33 | 33 | throw new InvalidArgumentException(\sprintf('Service definition "%s" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.', $id)); |
34 | 34 | } |
35 | 35 | $this->changes[\strtolower($id)] = $id; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function __construct(ResolveClassPass $resolveClassPass = null) |
25 | 25 | { |
26 | 26 | if (null === $resolveClassPass) { |
27 | - @\trigger_error('The ' . __CLASS__ . ' class is deprecated since Symfony 3.3 and will be removed in 4.0.', \E_USER_DEPRECATED); |
|
27 | + @\trigger_error('The '.__CLASS__.' class is deprecated since Symfony 3.3 and will be removed in 4.0.', \E_USER_DEPRECATED); |
|
28 | 28 | } |
29 | 29 | $this->resolveClassPass = $resolveClassPass; |
30 | 30 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function process(ContainerBuilder $container) |
35 | 35 | { |
36 | 36 | // works only since php 7.0 and hhvm 3.11 |
37 | - if (!\method_exists(\ReflectionMethod::class, 'getReturnType')) { |
|
37 | + if ( ! \method_exists(\ReflectionMethod::class, 'getReturnType')) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | $resolveClassPassChanges = null !== $this->resolveClassPass ? $this->resolveClassPass->getChanges() : []; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return; |
50 | 50 | } |
51 | 51 | $factory = $definition->getFactory(); |
52 | - if (null === $factory || !isset($resolveClassPassChanges[$id]) && null !== $definition->getClass()) { |
|
52 | + if (null === $factory || ! isset($resolveClassPassChanges[$id]) && null !== $definition->getClass()) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | $class = null; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } else { |
73 | 73 | $class = $factory[0]; |
74 | 74 | } |
75 | - if (!($m = $container->getReflectionClass($class, \false))) { |
|
75 | + if ( ! ($m = $container->getReflectionClass($class, \false))) { |
|
76 | 76 | return; |
77 | 77 | } |
78 | 78 | try { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | } |
84 | 84 | $returnType = $m->getReturnType(); |
85 | - if (null !== $returnType && !$returnType->isBuiltin()) { |
|
85 | + if (null !== $returnType && ! $returnType->isBuiltin()) { |
|
86 | 86 | $returnType = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; |
87 | 87 | if (null !== $class) { |
88 | 88 | $declaringClass = $m->getDeclaringClass()->getName(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $returnType = \get_parent_class($declaringClass) ?: null; |
93 | 93 | } |
94 | 94 | } |
95 | - if (null !== $returnType && (!isset($resolveClassPassChanges[$id]) || $returnType !== $resolveClassPassChanges[$id])) { |
|
95 | + if (null !== $returnType && ( ! isset($resolveClassPassChanges[$id]) || $returnType !== $resolveClassPassChanges[$id])) { |
|
96 | 96 | @\trigger_error(\sprintf('Relying on its factory\'s return-type to define the class of service "%s" is deprecated since Symfony 3.3 and won\'t work in 4.0. Set the "class" attribute to "%s" on the service definition instead.', $id, $returnType), \E_USER_DEPRECATED); |
97 | 97 | } |
98 | 98 | $definition->setClass($returnType); |