Merge branch '4.4' into 5.2

* 4.4:
  CS fix
  Missing translations from traits
This commit is contained in:
Nicolas Grekas 2021-07-04 11:32:21 +02:00
commit ce2300a930
3 changed files with 13 additions and 15 deletions

View File

@ -104,9 +104,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getArgument($name) public function getArgument(string $name)
{ {
if (!$this->definition->hasArgument((string) $name)) { if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
} }
@ -116,9 +116,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setArgument($name, $value) public function setArgument(string $name, $value)
{ {
if (!$this->definition->hasArgument((string) $name)) { if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
} }
@ -128,9 +128,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function hasArgument($name) public function hasArgument(string $name)
{ {
return $this->definition->hasArgument((string) $name); return $this->definition->hasArgument($name);
} }
/** /**

View File

@ -83,32 +83,27 @@ interface InputInterface
/** /**
* Returns the argument value for a given argument name. * Returns the argument value for a given argument name.
* *
* @param string $name The argument name
*
* @return mixed * @return mixed
* *
* @throws InvalidArgumentException When argument given doesn't exist * @throws InvalidArgumentException When argument given doesn't exist
*/ */
public function getArgument($name); public function getArgument(string $name);
/** /**
* Sets an argument value by name. * Sets an argument value by name.
* *
* @param string $name The argument name * @param mixed $value The argument value
* @param mixed $value The argument value
* *
* @throws InvalidArgumentException When argument given doesn't exist * @throws InvalidArgumentException When argument given doesn't exist
*/ */
public function setArgument($name, $value); public function setArgument(string $name, $value);
/** /**
* Returns true if an InputArgument object exists by name or position. * Returns true if an InputArgument object exists by name or position.
* *
* @param string $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise * @return bool true if the InputArgument object exists, false otherwise
*/ */
public function hasArgument($name); public function hasArgument(string $name);
/** /**
* Returns all the given options merged with the default values. * Returns all the given options merged with the default values.

View File

@ -60,6 +60,9 @@ class TranslatorPathsPass extends AbstractRecursivePass
foreach ($this->paths as $class => $_) { foreach ($this->paths as $class => $_) {
if (($r = $container->getReflectionClass($class)) && !$r->isInterface()) { if (($r = $container->getReflectionClass($class)) && !$r->isInterface()) {
$paths[] = $r->getFileName(); $paths[] = $r->getFileName();
foreach ($r->getTraits() as $trait) {
$paths[] = $trait->getFileName();
}
} }
} }
if ($paths) { if ($paths) {