You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony version(s) affected: 4.4/5.0/5.1/5.2 Description
The ConfigDataCollector class allows for an optional KernelInterface $kernel attribute. Note there are several isset checks for this private property. This conflicts with the getter method isSymfonyLts as it has a fixed return type bool.
How to reproduce
<?phpuseSymfony\Component\HttpKernel\DataCollector\ConfigDataCollector;
$c = newConfigDataCollector();
$c->collect(newRequest(), newResponse());
$c->isSymfonyLts();
// TypeError: Return value of Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::isSymfonyLts() must be of the type bool, null returned
Possible Solution
Allow for the return type to be nullable and take advantage of the already typed return. Use the null coalescing operator on the attribute to retrieve the value.
Additional context
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected: 4.4/5.0/5.1/5.2
Description
The
ConfigDataCollector
class allows for an optionalKernelInterface $kernel
attribute. Note there are severalisset
checks for this private property. This conflicts with the getter methodisSymfonyLts
as it has a fixed return typebool
.How to reproduce
Possible Solution
Allow for the return type to be nullable and take advantage of the already typed return. Use the null coalescing operator on the attribute to retrieve the value.
Additional context
The text was updated successfully, but these errors were encountered: