From f10c50231fa8a6a1f0c5f8f1d04902fa0db3ac1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 5 Jun 2023 17:40:19 +0200 Subject: [PATCH] apply rector rules on list interfaces --- ...aultDataOnExportFilterAggregatorRector.php | 2 + ...th-no-method-get-form-default-data.php.inc | 135 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc diff --git a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php index a6a375088..237aa17b8 100644 --- a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php +++ b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\DirectExportInterface; use Chill\MainBundle\Export\ExportInterface; use Chill\MainBundle\Export\FilterInterface; +use Chill\MainBundle\Export\ListInterface; use PhpParser\Node; use Rector\Core\Rector\AbstractRector; use Rector\Symfony\NodeAnalyzer\ClassAnalyzer; @@ -51,6 +52,7 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends Abstra && !$this->classAnalyzer->hasImplements($node, AggregatorInterface::class) && !$this->classAnalyzer->hasImplements($node, ExportInterface::class) && !$this->classAnalyzer->hasImplements($node, DirectExportInterface::class) + && !$this->classAnalyzer->hasImplements($node, ListInterface::class) ) { return null; } diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc new file mode 100644 index 000000000..99cea7155 --- /dev/null +++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc @@ -0,0 +1,135 @@ + +----- +