stof / StofDoctrineExtensionsBundle

Integration bundle for DoctrineExtensions by l3pp4rd in Symfony
https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/index.html
MIT License
1.89k stars 379 forks source link

SoftDeleteableFilter 'addFilterConstraint' not compatible #482

Closed RomainMILLAN closed 4 months ago

RomainMILLAN commented 5 months ago

Describe the bug I'am on new project and now install SoftDeleteable, but an error is created on cache clear because the function public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) are not compatible with the function of abstract class SQLFilter abstract public function addFilterConstraint(ClassMetadata $targetEntity, string $targetTableAlias): string;.

To Reproduce Steps to reproduce the behavior:

Expected behavior It's possible to add the return statement of the addFilterConstraint method to be compatible with the abstract class SQLFilter ?

Error

symfony console ca:cl -e 'dev'

 // Clearing the cache for the dev environment with debug true                                                          

PHP Fatal error:  Declaration of Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, $targetTableAlias) must be compatible with Doctrine\ORM\Query\Filter\SQLFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, string $targetTableAlias): string in /Users/romainmillan/Sites/Develop/bteck/vendor/gedmo/doctrine-extensions/src/SoftDeleteable/Filter/SoftDeleteableFilter.php on line 54

Fatal error: Declaration of Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, $targetTableAlias) must be compatible with Doctrine\ORM\Query\Filter\SQLFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, string $targetTableAlias): string in /Users/romainmillan/Sites/Develop/bteck/vendor/gedmo/doctrine-extensions/src/SoftDeleteable/Filter/SoftDeleteableFilter.php on line 54
05:58:03 CRITICAL  [php] Fatal Compile Error: Declaration of Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, $targetTableAlias) must be compatible with Doctrine\ORM\Query\Filter\SQLFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, string $targetTableAlias): string ["exception" => Symfony\Component\ErrorHandler\Error\FatalError { …}]

In SoftDeleteableFilter.php line 54:

  Compile Error: Declaration of Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter::addFilterConstraint(Doctrine\ORM\Mapping\ClassMetadata $targetEntity, $targetTableAlias) must be compatible with Doctrine\ORM\Query\Filter\SQLFilter::addFilterConstraint(Doctrine\ORM\Mappin  
  g\ClassMetadata $targetEntity, string $targetTableAlias): string                                                                                                                                                                                                               

cache:clear [--no-warmup] [--no-optional-warmers]
stof commented 4 months ago

Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter is not defined in this bundle but in the extensions themselves. This should be reported to https://github.com/doctrine-extensions/DoctrineExtensions/

Also note that the stable release of those extensions does not support doctrine/orm 3.0 yet, which might be related to the error you get.