StofDoctrineExtensionsBundle icon indicating copy to clipboard operation
StofDoctrineExtensionsBundle copied to clipboard

SoftDeleteableFilter 'addFilterConstraint' not compatible

Open RomainMILLAN opened this issue 1 year ago • 0 comments

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:

  • Have a project on Symfony 7 version.
  • Try to install SoftDeleteable filter.

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]

RomainMILLAN avatar May 20 '24 06:05 RomainMILLAN