Skip to content

Commit f88dcb2

Browse files
committed
Fix redundant type casts
1 parent 117d7f1 commit f88dcb2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Loader/XmlFileLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private function parseDefinition(\DOMElement $service, string $file, array $defa
197197
if ($alias = $service->getAttribute('alias')) {
198198
$this->validateAlias($service, $file);
199199

200-
$this->container->setAlias((string) $service->getAttribute('id'), $alias = new Alias($alias));
200+
$this->container->setAlias($service->getAttribute('id'), $alias = new Alias($alias));
201201
if ($publicAttr = $service->getAttribute('public')) {
202202
$alias->setPublic(XmlUtils::phpize($publicAttr));
203203
} elseif (isset($defaults['public'])) {
@@ -345,7 +345,7 @@ private function parseDefinition(\DOMElement $service, string $file, array $defa
345345
}
346346

347347
if ('' === $tag->getAttribute('name')) {
348-
throw new InvalidArgumentException(sprintf('The tag name for service "%s" in "%s" must be a non-empty string.', (string) $service->getAttribute('id'), $file));
348+
throw new InvalidArgumentException(sprintf('The tag name for service "%s" in "%s" must be a non-empty string.', $service->getAttribute('id'), $file));
349349
}
350350

351351
$definition->addTag($tag->getAttribute('name'), $parameters);
@@ -374,7 +374,7 @@ private function parseDefinition(\DOMElement $service, string $file, array $defa
374374
} elseif ('null' === $decorationOnInvalid) {
375375
$invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
376376
} else {
377-
throw new InvalidArgumentException(sprintf('Invalid value "%s" for attribute "decoration-on-invalid" on service "%s". Did you mean "exception", "ignore" or "null" in "%s"?', $decorationOnInvalid, (string) $service->getAttribute('id'), $file));
377+
throw new InvalidArgumentException(sprintf('Invalid value "%s" for attribute "decoration-on-invalid" on service "%s". Did you mean "exception", "ignore" or "null" in "%s"?', $decorationOnInvalid, $service->getAttribute('id'), $file));
378378
}
379379

380380
$renameId = $service->hasAttribute('decoration-inner-name') ? $service->getAttribute('decoration-inner-name') : null;

0 commit comments

Comments
 (0)