Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -27,12 +27,28 @@ class TranslatorPathsPass extends AbstractRecursivePass
private $updateCommandServiceId;
private $resolverServiceId;
private $level = 0;
/**
* @var array<string, bool>
*/
private $paths = [];
/**
* @var array<int, Definition>
*/
private $definitions = [];
/**
* @var array<string, array<string, bool>>
*/
private $controllers = [];
public function __construct(string $translatorServiceId = 'translator', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update', string $resolverServiceId = 'argument_resolver.service')
public function __construct(string $translatorServiceId = 'translator', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_extract', string $resolverServiceId = 'argument_resolver.service')
{
if (0 < \func_num_args()) {
trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
}
$this->translatorServiceId = $translatorServiceId;
$this->debugCommandServiceId = $debugCommandServiceId;
$this->updateCommandServiceId = $updateCommandServiceId;
@@ -46,9 +62,9 @@ class TranslatorPathsPass extends AbstractRecursivePass
}
foreach ($this->findControllerArguments($container) as $controller => $argument) {
$id = \substr($controller, 0, \strpos($controller, ':') ?: \strlen($controller));
$id = substr($controller, 0, strpos($controller, ':') ?: \strlen($controller));
if ($container->hasDefinition($id)) {
list($locatorRef) = $argument->getValues();
[$locatorRef] = $argument->getValues();
$this->controllers[(string) $locatorRef][$container->getDefinition($id)->getClass()] = true;
}
}
@@ -60,6 +76,9 @@ class TranslatorPathsPass extends AbstractRecursivePass
foreach ($this->paths as $class => $_) {
if (($r = $container->getReflectionClass($class)) && !$r->isInterface()) {
$paths[] = $r->getFileName();
foreach ($r->getTraits() as $trait) {
$paths[] = $trait->getFileName();
}
}
}
if ($paths) {
@@ -79,7 +98,7 @@ class TranslatorPathsPass extends AbstractRecursivePass
}
}
protected function processValue($value, $isRoot = false)
protected function processValue($value, bool $isRoot = false)
{
if ($value instanceof Reference) {
if ((string) $value === $this->translatorServiceId) {