Skip to content

Commit ed6dcf8

Browse files
Merge branch '2.8' into 3.3
* 2.8: [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. .php_cs.dist - simplify config [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
2 parents f520e2c + 3751465 commit ed6dcf8

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ public static function getServiceConditionals($value)
14061406
foreach ($value as $v) {
14071407
$services = array_unique(array_merge($services, self::getServiceConditionals($v)));
14081408
}
1409-
} elseif ($value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_INVALID_REFERENCE) {
1409+
} elseif ($value instanceof Reference && ContainerInterface::IGNORE_ON_INVALID_REFERENCE === $value->getInvalidBehavior()) {
14101410
$services[] = (string) $value;
14111411
}
14121412

Definition.php

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

96-
if (is_string($factory) && strpos($factory, '::') !== false) {
96+
if (is_string($factory) && false !== strpos($factory, '::')) {
9797
$factory = explode('::', $factory, 2);
9898
}
9999

@@ -758,7 +758,7 @@ public function setConfigurator($configurator)
758758
{
759759
$this->changes['configurator'] = true;
760760

761-
if (is_string($configurator) && strpos($configurator, '::') !== false) {
761+
if (is_string($configurator) && false !== strpos($configurator, '::')) {
762762
$configurator = explode('::', $configurator, 2);
763763
}
764764

Dumper/XmlDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ 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');
312312
}
313313
} 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
@@ -529,7 +529,7 @@ private function getChildren(\DOMNode $node, $name)
529529
{
530530
$children = array();
531531
foreach ($node->childNodes as $child) {
532-
if ($child instanceof \DOMElement && $child->localName === $name && $child->namespaceURI === self::NS) {
532+
if ($child instanceof \DOMElement && $child->localName === $name && self::NS === $child->namespaceURI) {
533533
$children[] = $child;
534534
}
535535
}
@@ -626,7 +626,7 @@ private function validateAlias(\DOMElement $alias, $file)
626626
}
627627

628628
foreach ($alias->childNodes as $child) {
629-
if ($child instanceof \DOMElement && $child->namespaceURI === self::NS) {
629+
if ($child instanceof \DOMElement && self::NS === $child->namespaceURI) {
630630
@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);
631631
}
632632
}
@@ -669,7 +669,7 @@ private function validateExtensions(\DOMDocument $dom, $file)
669669
private function loadFromExtensions(\DOMDocument $xml)
670670
{
671671
foreach ($xml->documentElement->childNodes as $node) {
672-
if (!$node instanceof \DOMElement || $node->namespaceURI === self::NS) {
672+
if (!$node instanceof \DOMElement || self::NS === $node->namespaceURI) {
673673
continue;
674674
}
675675

0 commit comments

Comments
 (0)