[export][rector] rector rules to add get form default data on export, aggregator, direct export

This commit is contained in:
2023-06-05 16:41:55 +02:00
parent 02afcb30d4
commit d5ee158caa
4 changed files with 314 additions and 1 deletions

View File

@@ -11,6 +11,9 @@ declare(strict_types=1);
namespace Utils\Rector\Rector;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Export\DirectExportInterface;
use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FilterInterface;
use PhpParser\Node;
use Rector\Core\Rector\AbstractRector;
@@ -43,7 +46,12 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends Abstra
return null;
}
if (!$this->classAnalyzer->hasImplements($node, FilterInterface::class)) {
if (
!$this->classAnalyzer->hasImplements($node, FilterInterface::class)
&& !$this->classAnalyzer->hasImplements($node, AggregatorInterface::class)
&& !$this->classAnalyzer->hasImplements($node, ExportInterface::class)
&& !$this->classAnalyzer->hasImplements($node, DirectExportInterface::class)
) {
return null;
}