[Translation] fix return type declarations
This commit is contained in:
parent
ca1fad471e
commit
70feaa407e
@ -107,6 +107,8 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
|
@ -97,6 +97,8 @@ class TranslationNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
|
@ -106,9 +106,7 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $directory
|
||||
*
|
||||
* @return array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function extractFromDirectory($directory)
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|Data
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
|
@ -21,9 +21,9 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
||||
abstract class AbstractFileExtractor
|
||||
{
|
||||
/**
|
||||
* @param string|array $resource Files, a file or a directory
|
||||
* @param string|iterable $resource Files, a file or a directory
|
||||
*
|
||||
* @return array
|
||||
* @return iterable
|
||||
*/
|
||||
protected function extractFiles($resource)
|
||||
{
|
||||
@ -79,7 +79,7 @@ abstract class AbstractFileExtractor
|
||||
/**
|
||||
* @param string|array $resource Files, a file or a directory
|
||||
*
|
||||
* @return array files to be extracted
|
||||
* @return iterable files to be extracted
|
||||
*/
|
||||
abstract protected function extractFromDirectory($resource);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
*
|
||||
* @param mixed $token
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
protected function normalizeToken($token)
|
||||
{
|
||||
@ -257,9 +257,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $directory
|
||||
*
|
||||
* @return array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function extractFromDirectory($directory)
|
||||
{
|
||||
|
@ -52,6 +52,10 @@ class YamlFileLoader extends FileLoader
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
return $messages;
|
||||
if (null !== $messages && !\is_array($messages)) {
|
||||
throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource));
|
||||
}
|
||||
|
||||
return $messages ?: [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user