Skip to content

Commit 4e3cbd2

Browse files
Merge branch '3.3' into 3.4
* 3.3: [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction [Filesystem] mirror - fix copying content with same name as source/target. Removed unnecessary getDefinition() call. .php_cs.dist - simplify config [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2 parents 6688666 + ed6dcf8 commit 4e3cbd2

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ public static function getServiceConditionals($value)
14231423
foreach ($value as $v) {
14241424
$services = array_unique(array_merge($services, self::getServiceConditionals($v)));
14251425
}
1426-
} elseif ($value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_INVALID_REFERENCE) {
1426+
} elseif ($value instanceof Reference && ContainerInterface::IGNORE_ON_INVALID_REFERENCE === $value->getInvalidBehavior()) {
14271427
$services[] = (string) $value;
14281428
}
14291429

@@ -1447,7 +1447,7 @@ public static function getInitializedConditionals($value)
14471447
foreach ($value as $v) {
14481448
$services = array_unique(array_merge($services, self::getInitializedConditionals($v)));
14491449
}
1450-
} elseif ($value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE) {
1450+
} elseif ($value instanceof Reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior()) {
14511451
$services[] = (string) $value;
14521452
}
14531453

Definition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function setFactory($factory)
9696
{
9797
$this->changes['factory'] = true;
9898

99-
if (is_string($factory) && strpos($factory, '::') !== false) {
99+
if (is_string($factory) && false !== strpos($factory, '::')) {
100100
$factory = explode('::', $factory, 2);
101101
}
102102

@@ -790,7 +790,7 @@ public function setConfigurator($configurator)
790790
{
791791
$this->changes['configurator'] = true;
792792

793-
if (is_string($configurator) && strpos($configurator, '::') !== false) {
793+
if (is_string($configurator) && false !== strpos($configurator, '::')) {
794794
$configurator = explode('::', $configurator, 2);
795795
}
796796

Dumper/XmlDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ private function convertParameters(array $parameters, $type, \DOMElement $parent
305305
$element->setAttribute('type', 'service');
306306
$element->setAttribute('id', (string) $value);
307307
$behaviour = $value->getInvalidBehavior();
308-
if ($behaviour == ContainerInterface::NULL_ON_INVALID_REFERENCE) {
308+
if (ContainerInterface::NULL_ON_INVALID_REFERENCE == $behaviour) {
309309
$element->setAttribute('on-invalid', 'null');
310-
} elseif ($behaviour == ContainerInterface::IGNORE_ON_INVALID_REFERENCE) {
310+
} elseif (ContainerInterface::IGNORE_ON_INVALID_REFERENCE == $behaviour) {
311311
$element->setAttribute('on-invalid', 'ignore');
312-
} elseif ($behaviour == ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE) {
312+
} elseif (ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE == $behaviour) {
313313
$element->setAttribute('on-invalid', 'ignore_uninitialized');
314314
}
315315
} elseif ($value instanceof Definition) {

Extension/Extension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getNamespace()
6666
public function getAlias()
6767
{
6868
$className = get_class($this);
69-
if (substr($className, -9) != 'Extension') {
69+
if ('Extension' != substr($className, -9)) {
7070
throw new BadMethodCallException('This extension does not follow the naming convention; you must overwrite the getAlias() method.');
7171
}
7272
$classBaseName = substr(strrchr($className, '\\'), 1, -9);

Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function findClasses($namespace, $pattern, $excludePattern)
111111
if (null === $prefixLen) {
112112
$prefixLen = strlen($resource->getPrefix());
113113

114-
if ($excludePrefix && strpos($excludePrefix, $resource->getPrefix()) !== 0) {
114+
if ($excludePrefix && 0 !== strpos($excludePrefix, $resource->getPrefix())) {
115115
throw new InvalidArgumentException(sprintf('Invalid "exclude" pattern when importing classes for "%s": make sure your "exclude" pattern (%s) is a subset of the "resource" pattern (%s)', $namespace, $excludePattern, $pattern));
116116
}
117117
}

Loader/XmlFileLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ private function getChildren(\DOMNode $node, $name)
549549
{
550550
$children = array();
551551
foreach ($node->childNodes as $child) {
552-
if ($child instanceof \DOMElement && $child->localName === $name && $child->namespaceURI === self::NS) {
552+
if ($child instanceof \DOMElement && $child->localName === $name && self::NS === $child->namespaceURI) {
553553
$children[] = $child;
554554
}
555555
}
@@ -646,7 +646,7 @@ private function validateAlias(\DOMElement $alias, $file)
646646
}
647647

648648
foreach ($alias->childNodes as $child) {
649-
if ($child instanceof \DOMElement && $child->namespaceURI === self::NS) {
649+
if ($child instanceof \DOMElement && self::NS === $child->namespaceURI) {
650650
@trigger_error(sprintf('Using the element "%s" is deprecated for the service "%s" which is defined as an alias in "%s". The XmlFileLoader will raise an exception in Symfony 4.0, instead of silently ignoring unsupported elements.', $child->localName, $alias->getAttribute('id'), $file), E_USER_DEPRECATED);
651651
}
652652
}
@@ -689,7 +689,7 @@ private function validateExtensions(\DOMDocument $dom, $file)
689689
private function loadFromExtensions(\DOMDocument $xml)
690690
{
691691
foreach ($xml->documentElement->childNodes as $node) {
692-
if (!$node instanceof \DOMElement || $node->namespaceURI === self::NS) {
692+
if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
693693
continue;
694694
}
695695

0 commit comments

Comments
 (0)