itsgoingd / clockwork

Clockwork - php dev tools in your browser - server-side component
https://underground.works/clockwork
MIT License
5.7k stars 320 forks source link

Fix symfony warnings #545

Closed victorzhuk closed 2 years ago

victorzhuk commented 2 years ago
[info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtensionClass()" might add "string" as a native return type declaration in the future. Do the same in child class "Clockwork\Support\Symfony\ClockworkBundle" now to avoid errors or add an explicit @return annotation to suppress this message.
itsgoingd commented 2 years ago

Hey, can you please provide more info on how this error is triggered and how the added docblock fixes the issue? I'm not very familiar with Symfony.

BafS commented 2 years ago
class ClockworkBundle extends Bundle
{
-   protected function getContainerExtensionClass()
+   protected function getContainerExtensionClass(): string
    {
        return ClockworkExtension::class;
    }
}

You need to add the return type-hint to getContainerExtensionClass to be compatible with Symfony 6, but for this you need to drop PHP <7 or to do hacky things. I would strongly favor the former option and even drop PHP <7.4, it's not supported since a while (PHP 7 support ended in Jan 2019 !).

More info https://www.php.net/supported-versions.php