mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -15,16 +15,15 @@ use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Contracts\Service\Attribute\Required;
|
||||
|
||||
/**
|
||||
* Looks for definitions with autowiring enabled and registers their corresponding "@required" methods as setters.
|
||||
* Looks for definitions with autowiring enabled and registers their corresponding "#[Required]" methods as setters.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class AutowireRequiredMethodsPass extends AbstractRecursivePass
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected bool $skipScalars = true;
|
||||
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
$value = parent::processValue($value, $isRoot);
|
||||
|
||||
@@ -50,7 +49,7 @@ class AutowireRequiredMethodsPass extends AbstractRecursivePass
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (\PHP_VERSION_ID >= 80000 && $r->getAttributes(Required::class)) {
|
||||
if ($r->getAttributes(Required::class)) {
|
||||
if ($this->isWither($r, $r->getDocComment() ?: '')) {
|
||||
$withers[] = [$r->name, [], true];
|
||||
} else {
|
||||
@@ -60,6 +59,8 @@ class AutowireRequiredMethodsPass extends AbstractRecursivePass
|
||||
}
|
||||
if (false !== $doc = $r->getDocComment()) {
|
||||
if (false !== stripos($doc, '@required') && preg_match('#(?:^/\*\*|\n\s*+\*)\s*+@required(?:\s|\*/$)#i', $doc)) {
|
||||
trigger_deprecation('symfony/dependency-injection', '6.3', 'Relying on the "@required" annotation on method "%s::%s()" is deprecated, use the "Symfony\Contracts\Service\Attribute\Required" attribute instead.', $reflectionMethod->class, $reflectionMethod->name);
|
||||
|
||||
if ($this->isWither($reflectionMethod, $doc)) {
|
||||
$withers[] = [$reflectionMethod->name, [], true];
|
||||
} else {
|
||||
@@ -73,7 +74,7 @@ class AutowireRequiredMethodsPass extends AbstractRecursivePass
|
||||
}
|
||||
try {
|
||||
$r = $r->getPrototype();
|
||||
} catch (\ReflectionException $e) {
|
||||
} catch (\ReflectionException) {
|
||||
break; // method has no prototype
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user