From 8c1e696776de1e7f29ca3e1ddc3661650443e7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:33:56 +0200 Subject: [PATCH 1/7] add qa tools --- composer.json | 9 +++++++++ ecs.php | 39 +++++++++++++++++++++++++++++++++++++++ phpstan.neon | 0 rector.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 ecs.php create mode 100644 phpstan.neon create mode 100644 rector.php diff --git a/composer.json b/composer.json index 0d15999..7a09cfb 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,15 @@ "contao/core-bundle": "^5.3", "symfony/http-kernel": "^6.4 || ^7.0" }, + "require-dev": { + "contao/core-bundle": "5.3.*", + "rector/rector": "^2.5", + "contao/contao-rector": "dev-main", + "symplify/easy-coding-standard": "^13.2", + "phpstan/phpstan": "^2.2", + "phpstan/phpstan-symfony": "^2.0", + "contao/manager-plugin": "^2.13" + }, "autoload": { "psr-4": { "HeimrichHannot\\FormFieldsCollectionBundle\\": "src/" diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..95f407e --- /dev/null +++ b/ecs.php @@ -0,0 +1,39 @@ +withPaths([ + __DIR__ . '/src', +// __DIR__ . '/contao', + + ]) + + // add a single rule + ->withRules([ + NoUnusedImportsFixer::class, + BracesPositionFixer::class, + ]) + + // add sets - group of rules + ->withPreparedSets( + arrays: true, + comments: true, + docblocks: true, + spaces: true, + namespaces: true, + ) + ->withPhpCsFixerSets(symfony: true) + ->withSkip([ + NotOperatorWithSuccessorSpaceFixer::class, + MethodChainingIndentationFixer::class => [ + '*/DependencyInjection/Configuration.php', + 'src/*Bundle.php' + ], + ]); \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..e69de29 diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..d7561e4 --- /dev/null +++ b/rector.php @@ -0,0 +1,46 @@ +withPaths([ + __DIR__ . '/src', + __DIR__ . '/contao', + + ]) + ->withPhpVersion(PhpVersion::PHP_84) + ->withRules([ + AddVoidReturnTypeWhereNoReturnRector::class, + # In Vorbereitung für PHP 8.4: + ExplicitNullableParamTypeRector::class, + ]) + + ->withImportNames( + importShortClasses: false, + removeUnusedImports: true + ) + ->withComposerBased( + twig: true, + doctrine: true, + phpunit: true, + symfony: true, + ) + ->withSets([ + LevelSetList::UP_TO_PHP_82, + ContaoLevelSetList::UP_TO_CONTAO_53, + ContaoSetList::FQCN, + ContaoSetList::ANNOTATIONS_TO_ATTRIBUTES, + ]) + ->withSkip([ + ArrayToFirstClassCallableRector::class, + ]) + ; \ No newline at end of file From 1a73cb3bd007838f54a61ff3da6720d9289ba666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:34:06 +0200 Subject: [PATCH 2/7] run rector --- contao/dca/tl_form_field.php | 14 ++++++++++---- src/FrontendWidget/SingleCheckboxWidget.php | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/contao/dca/tl_form_field.php b/contao/dca/tl_form_field.php index 35b0b79..a2f2557 100644 --- a/contao/dca/tl_form_field.php +++ b/contao/dca/tl_form_field.php @@ -5,14 +5,20 @@ $dca = &$GLOBALS['TL_DCA']['tl_form_field']; -$dca['palettes'][DateTimeWidget::TYPE] = '{type_legend},type,name,label;{fconfig_legend},mandatory,dateTimeType,defaultDateTimeValue;{expert_legend:hide},class,minval,maxval,accesskey,tabindex;{template_legend:hide},customTpl;{invisible_legend:hide},invisible'; +$dca['palettes'][DateTimeWidget::TYPE] = <<get('contao.insert_tag.parser')->replaceInline((string)$this->text); if ( - preg_match('/^\s*]*>(.*)<\/p>\s*$/is', $text, $matches) === 1 + preg_match('/^\s*]*>(.*)<\/p>\s*$/is', (string) $text, $matches) === 1 && preg_match('/<\/?p\b/i', $matches[1]) !== 1 ) { $text = trim($matches[1]); @@ -44,7 +44,7 @@ protected function getOption(): array return $option; } - public function getAttributes($arrStrip = array()) + public function getAttributes($arrStrip = []) { if ($this->mandatory) { $this->arrAttributes['required'] = 'required'; From 53fd6ec2611daefc992d3945c8477a39dcf36ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:40:49 +0200 Subject: [PATCH 3/7] run phpstan --- composer.json | 3 ++- phpstan.neon | 11 +++++++++++ src/EventListener/DateTimeListener.php | 1 + src/FormFieldModel.php | 11 +++++++++++ src/FrontendWidget/DateTimeWidget.php | 5 +++++ src/FrontendWidget/SingleCheckboxWidget.php | 3 +++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/FormFieldModel.php diff --git a/composer.json b/composer.json index 7a09cfb..d2545b4 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "symplify/easy-coding-standard": "^13.2", "phpstan/phpstan": "^2.2", "phpstan/phpstan-symfony": "^2.0", - "contao/manager-plugin": "^2.13" + "contao/manager-plugin": "^2.13", + "terminal42/contao-leads": "^3.2" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index e69de29..964e39d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -0,0 +1,11 @@ +parameters: + level: 3 + paths: + - src + - contao +# universalObjectCratesClasses: +# - Contao\Database\Result +# - Contao\Model +# - Contao\Template +includes: + - vendor/phpstan/phpstan-symfony/extension.neon \ No newline at end of file diff --git a/src/EventListener/DateTimeListener.php b/src/EventListener/DateTimeListener.php index 18f2dca..fca4685 100644 --- a/src/EventListener/DateTimeListener.php +++ b/src/EventListener/DateTimeListener.php @@ -16,6 +16,7 @@ public function onLoadCallback(DataContainer $dc): void return; } + /** @var \HeimrichHannot\FormFieldsCollectionBundle\Model\FormFieldModel $widget */ $widget = FormFieldModel::findByPk($dc->id); if (!$widget || (DateTimeWidget::TYPE !== $widget->type)) { return; diff --git a/src/FormFieldModel.php b/src/FormFieldModel.php new file mode 100644 index 0000000..ad0c94d --- /dev/null +++ b/src/FormFieldModel.php @@ -0,0 +1,11 @@ + Date: Tue, 30 Jun 2026 11:47:17 +0200 Subject: [PATCH 4/7] phpstan level 4 --- phpstan.neon | 2 +- src/EventListener/DateTimeListener.php | 6 +++--- src/EventListener/Integrations/LeadsListener.php | 4 ++-- src/EventListener/SingleCheckboxListener.php | 2 +- src/FrontendWidget/DateTimeWidget.php | 5 +++++ 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 964e39d..182927a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 3 + level: 4 paths: - src - contao diff --git a/src/EventListener/DateTimeListener.php b/src/EventListener/DateTimeListener.php index fca4685..bfc1d3a 100644 --- a/src/EventListener/DateTimeListener.php +++ b/src/EventListener/DateTimeListener.php @@ -12,13 +12,13 @@ class DateTimeListener #[AsCallback(table: 'tl_form_field', target: 'config.onload')] public function onLoadCallback(DataContainer $dc): void { - if (!$dc || !$dc->id) { + if (!$dc->id) { return; } - /** @var \HeimrichHannot\FormFieldsCollectionBundle\Model\FormFieldModel $widget */ + /** @var \HeimrichHannot\FormFieldsCollectionBundle\Model\FormFieldModel|null $widget */ $widget = FormFieldModel::findByPk($dc->id); - if (!$widget || (DateTimeWidget::TYPE !== $widget->type)) { + if (DateTimeWidget::TYPE !== $widget?->type) { return; } diff --git a/src/EventListener/Integrations/LeadsListener.php b/src/EventListener/Integrations/LeadsListener.php index 6823af1..9167280 100644 --- a/src/EventListener/Integrations/LeadsListener.php +++ b/src/EventListener/Integrations/LeadsListener.php @@ -20,7 +20,7 @@ public function onFormDataValueEvent(FormDataValueEvent $event): void $format = match ($event->getField()['dateTimeType']) { 'date' => Date::getNumericDateFormat(), 'time' => Date::getNumericTimeFormat(), - 'default' => null, + default => null, }; if (null === $format) { @@ -45,7 +45,7 @@ public function onFormDataLabelEvent(FormDataLabelEvent $event): void $format = match ($event->getField()['dateTimeType']) { 'date' => Date::getNumericDateFormat(), 'time' => Date::getNumericTimeFormat(), - 'default' => null, + default => null, }; if (null === $format) { diff --git a/src/EventListener/SingleCheckboxListener.php b/src/EventListener/SingleCheckboxListener.php index ec2eb88..bc846c8 100644 --- a/src/EventListener/SingleCheckboxListener.php +++ b/src/EventListener/SingleCheckboxListener.php @@ -12,7 +12,7 @@ class SingleCheckboxListener #[AsCallback(table: 'tl_form_field', target: 'config.onload')] public function onLoadCallback(DataContainer $dc): void { - if (!$dc || !$dc->id) { + if (!$dc->id) { return; } diff --git a/src/FrontendWidget/DateTimeWidget.php b/src/FrontendWidget/DateTimeWidget.php index 85755af..daaf23b 100644 --- a/src/FrontendWidget/DateTimeWidget.php +++ b/src/FrontendWidget/DateTimeWidget.php @@ -28,12 +28,14 @@ public function __construct($arrAttributes = null) $this->value = match ($this->dateTimeType) { 'date' => Date::parse('Y-m-d', $fieldModel->value), 'time' => Date::parse("H:i", $fieldModel->value), + default => '' }; } } elseif ('current' === $this->defaultDateTimeValue) { $this->value = match ($this->dateTimeType) { "", 'date' => date('Y-m-d'), 'time' => date('H:i'), + default => '' }; } @@ -66,6 +68,7 @@ protected function validator($varInput) return parent::validator(match ($this->dateTimeType) { 'date' => \DateTime::createFromFormat('Y-m-d', $varInput)->format(Date::getNumericDateFormat()), 'time' => \DateTime::createFromFormat('H:i', $varInput)->format(Date::getNumericTimeFormat()), + default => $varInput, }); } @@ -76,11 +79,13 @@ public function parse($arrAttributes=null) $dateTime = match ($this->dateTimeType) { 'date' => \DateTime::createFromFormat(Date::getNumericDateFormat(), $this->value), 'time' => \DateTime::createFromFormat(Date::getNumericTimeFormat(), $this->value), + default => $this->value, }; if (false !== $dateTime) { $this->value = match ($this->dateTimeType) { 'date' => $dateTime->format('Y-m-d'), 'time' => $dateTime->format('H:i'), + default => $this->value, }; } } From 6527dbb9635d3ed4199ff382e9d8d374ff21c83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:48:48 +0200 Subject: [PATCH 5/7] run ecs --- contao/dca/tl_form_field.php | 5 +++-- contao/languages/de/default.php | 10 +++++----- contao/languages/de/tl_form_field.php | 2 +- contao/languages/en/default.php | 10 +++++----- contao/languages/en/tl_form_field.php | 2 +- ecs.php | 2 +- src/ContaoManager/Plugin.php | 2 +- src/EventListener/DateTimeListener.php | 4 ++-- src/EventListener/Integrations/LeadsListener.php | 10 +++++++--- src/EventListener/SingleCheckboxListener.php | 2 +- src/FormFieldModel.php | 3 +-- src/FrontendWidget/DateTimeWidget.php | 13 +++++++------ src/FrontendWidget/SingleCheckboxWidget.php | 15 ++++++++------- src/HeimrichHannotFormFieldsCollectionBundle.php | 3 +-- 14 files changed, 44 insertions(+), 39 deletions(-) diff --git a/contao/dca/tl_form_field.php b/contao/dca/tl_form_field.php index a2f2557..9c76bd8 100644 --- a/contao/dca/tl_form_field.php +++ b/contao/dca/tl_form_field.php @@ -33,7 +33,9 @@ ], 'reference' => &$GLOBALS['TL_LANG']['tl_form_field'], 'default' => 'date', - 'eval' => ['tl_class' => 'w50'], + 'eval' => [ + 'tl_class' => 'w50', + ], 'sql' => "varchar(4) NOT NULL default ''", ]; @@ -51,4 +53,3 @@ ], 'sql' => "varchar(8) NOT NULL default ''", ]; - diff --git a/contao/languages/de/default.php b/contao/languages/de/default.php index 990adfb..a9d0286 100644 --- a/contao/languages/de/default.php +++ b/contao/languages/de/default.php @@ -3,11 +3,11 @@ use HeimrichHannot\FormFieldsCollectionBundle\FrontendWidget\DateTimeWidget; use HeimrichHannot\FormFieldsCollectionBundle\FrontendWidget\SingleCheckboxWidget; -$GLOBALS['TL_LANG']['FFL'][DateTimeWidget::TYPE] = [ +$GLOBALS['TL_LANG']['FFL'][DateTimeWidget::TYPE] = [ 'Datum-/ Zeitfeld (Form Fields Collection)', - 'Ermöglicht die Eingabe von Datum und/ oder Zeit.' + 'Ermöglicht die Eingabe von Datum und/ oder Zeit.', ]; -$GLOBALS['TL_LANG']['FFL'][SingleCheckboxWidget::TYPE] = [ +$GLOBALS['TL_LANG']['FFL'][SingleCheckboxWidget::TYPE] = [ 'Checkbox Einzeln (Form Fields Collection)', - 'Eine einzelne Checkbox, die entweder aktiviert oder deaktiviert sein kann.' -]; \ No newline at end of file + 'Eine einzelne Checkbox, die entweder aktiviert oder deaktiviert sein kann.', +]; diff --git a/contao/languages/de/tl_form_field.php b/contao/languages/de/tl_form_field.php index 46290e0..34caa66 100644 --- a/contao/languages/de/tl_form_field.php +++ b/contao/languages/de/tl_form_field.php @@ -11,4 +11,4 @@ $lang['defaultDateTimeCustomValue'][0] = 'Benutzerdefinierte Zeit'; $lang['defaultDateTimeCustomValue'][1] = 'Bitte geben Sie die benutzerdefinierte Zeit ein.'; $lang['singleCheckboxValue'][0] = 'Checkbox Wert'; -$lang['singleCheckboxValue'][1] = 'Legen Sie den Checkbox-Wert fest. Wenn leer, wird der Wert 1 sein.'; \ No newline at end of file +$lang['singleCheckboxValue'][1] = 'Legen Sie den Checkbox-Wert fest. Wenn leer, wird der Wert 1 sein.'; diff --git a/contao/languages/en/default.php b/contao/languages/en/default.php index 3803533..94e79ca 100644 --- a/contao/languages/en/default.php +++ b/contao/languages/en/default.php @@ -3,11 +3,11 @@ use HeimrichHannot\FormFieldsCollectionBundle\FrontendWidget\DateTimeWidget; use HeimrichHannot\FormFieldsCollectionBundle\FrontendWidget\SingleCheckboxWidget; -$GLOBALS['TL_LANG']['FFL'][DateTimeWidget::TYPE] = [ +$GLOBALS['TL_LANG']['FFL'][DateTimeWidget::TYPE] = [ 'Date/ time (Form Fields Collection)', - 'A date or time field.' + 'A date or time field.', ]; -$GLOBALS['TL_LANG']['FFL'][SingleCheckboxWidget::TYPE] = [ +$GLOBALS['TL_LANG']['FFL'][SingleCheckboxWidget::TYPE] = [ 'Checkbox Single (Form Fields Collection)', - 'A single checkbox that can be either checked or unchecked.' -]; \ No newline at end of file + 'A single checkbox that can be either checked or unchecked.', +]; diff --git a/contao/languages/en/tl_form_field.php b/contao/languages/en/tl_form_field.php index 6569a24..194bed3 100644 --- a/contao/languages/en/tl_form_field.php +++ b/contao/languages/en/tl_form_field.php @@ -11,4 +11,4 @@ $lang['defaultDateTimeCustomValue'][0] = 'Custom date/ time'; $lang['defaultDateTimeCustomValue'][1] = 'Please enter a custom date/ time.'; $lang['singleCheckboxValue'][0] = 'Checkbox Value'; -$lang['singleCheckboxValue'][1] = 'Set the checkbox value. If empty, the value will be 1.'; \ No newline at end of file +$lang['singleCheckboxValue'][1] = 'Set the checkbox value. If empty, the value will be 1.'; diff --git a/ecs.php b/ecs.php index 95f407e..4745de0 100644 --- a/ecs.php +++ b/ecs.php @@ -11,7 +11,7 @@ return ECSConfig::configure() ->withPaths([ __DIR__ . '/src', -// __DIR__ . '/contao', + __DIR__ . '/contao', ]) diff --git a/src/ContaoManager/Plugin.php b/src/ContaoManager/Plugin.php index 77e800d..c0a31c8 100644 --- a/src/ContaoManager/Plugin.php +++ b/src/ContaoManager/Plugin.php @@ -24,4 +24,4 @@ public function registerContainerConfiguration(LoaderInterface $loader, array $m { $loader->load('@HeimrichHannotFormFieldsCollectionBundle/config/services.yaml'); } -} \ No newline at end of file +} diff --git a/src/EventListener/DateTimeListener.php b/src/EventListener/DateTimeListener.php index bfc1d3a..edb99dc 100644 --- a/src/EventListener/DateTimeListener.php +++ b/src/EventListener/DateTimeListener.php @@ -35,6 +35,6 @@ public function onLoadCallback(DataContainer $dc): void $GLOBALS['TL_DCA']['tl_form_field']['fields']['maxval']['eval']['rgxp'] = 'time'; $GLOBALS['TL_DCA']['tl_form_field']['fields']['value']['label'] = &$GLOBALS['TL_LANG']['tl_form_field']['defaultDateTimeCustomValue']; break; - }; + } } -} \ No newline at end of file +} diff --git a/src/EventListener/Integrations/LeadsListener.php b/src/EventListener/Integrations/LeadsListener.php index 9167280..d88a6d9 100644 --- a/src/EventListener/Integrations/LeadsListener.php +++ b/src/EventListener/Integrations/LeadsListener.php @@ -25,12 +25,14 @@ public function onFormDataValueEvent(FormDataValueEvent $event): void if (null === $format) { $event->stopPropagation(); + return; } try { $event->setValue((new Date($event->getValue(), $format))->tstamp); - } catch (\Exception) {} + } catch (\Exception) { + } $event->stopPropagation(); } @@ -50,13 +52,15 @@ public function onFormDataLabelEvent(FormDataLabelEvent $event): void if (null === $format) { $event->stopPropagation(); + return; } try { $event->setLabel(Date::parse($format, $event->getValue())); - } catch (\Exception) {} + } catch (\Exception) { + } $event->stopPropagation(); } -} \ No newline at end of file +} diff --git a/src/EventListener/SingleCheckboxListener.php b/src/EventListener/SingleCheckboxListener.php index bc846c8..82776b5 100644 --- a/src/EventListener/SingleCheckboxListener.php +++ b/src/EventListener/SingleCheckboxListener.php @@ -26,4 +26,4 @@ public function onLoadCallback(DataContainer $dc): void $GLOBALS['TL_DCA']['tl_form_field']['fields']['text']['eval']['mandatory'] = true; $GLOBALS['TL_DCA']['tl_form_field']['fields']['value']['label'] = &$GLOBALS['TL_LANG']['tl_form_field']['singleCheckboxValue']; } -} \ No newline at end of file +} diff --git a/src/FormFieldModel.php b/src/FormFieldModel.php index ad0c94d..8856dd1 100644 --- a/src/FormFieldModel.php +++ b/src/FormFieldModel.php @@ -7,5 +7,4 @@ */ class FormFieldModel extends \Contao\FormFieldModel { - -} \ No newline at end of file +} diff --git a/src/FrontendWidget/DateTimeWidget.php b/src/FrontendWidget/DateTimeWidget.php index daaf23b..53319c2 100644 --- a/src/FrontendWidget/DateTimeWidget.php +++ b/src/FrontendWidget/DateTimeWidget.php @@ -27,15 +27,15 @@ public function __construct($arrAttributes = null) if ($fieldModel) { $this->value = match ($this->dateTimeType) { 'date' => Date::parse('Y-m-d', $fieldModel->value), - 'time' => Date::parse("H:i", $fieldModel->value), - default => '' + 'time' => Date::parse('H:i', $fieldModel->value), + default => '', }; } } elseif ('current' === $this->defaultDateTimeValue) { $this->value = match ($this->dateTimeType) { - "", 'date' => date('Y-m-d'), + '', 'date' => date('Y-m-d'), 'time' => date('H:i'), - default => '' + default => '', }; } @@ -72,7 +72,7 @@ protected function validator($varInput) }); } - public function parse($arrAttributes=null) + public function parse($arrAttributes = null) { // restore field value on errors if ($this->hasErrors()) { @@ -89,6 +89,7 @@ public function parse($arrAttributes=null) }; } } + return parent::parse($arrAttributes); } -} \ No newline at end of file +} diff --git a/src/FrontendWidget/SingleCheckboxWidget.php b/src/FrontendWidget/SingleCheckboxWidget.php index ba036bc..ba0740e 100644 --- a/src/FrontendWidget/SingleCheckboxWidget.php +++ b/src/FrontendWidget/SingleCheckboxWidget.php @@ -17,10 +17,10 @@ class SingleCheckboxWidget extends FormCheckbox protected function getOption(): array { - $text = System::getContainer()->get('contao.insert_tag.parser')->replaceInline((string)$this->text); + $text = System::getContainer()->get('contao.insert_tag.parser')->replaceInline((string) $this->text); if ( - preg_match('/^\s*]*>(.*)<\/p>\s*$/is', (string) $text, $matches) === 1 - && preg_match('/<\/?p\b/i', $matches[1]) !== 1 + 1 === preg_match('/^\s*]*>(.*)<\/p>\s*$/is', (string) $text, $matches) + && 1 !== preg_match('/<\/?p\b/i', $matches[1]) ) { $text = trim($matches[1]); } @@ -32,7 +32,7 @@ protected function getOption(): array 'id' => $this->strId, 'value' => $value, 'attributes' => $this->getAttributes(), - 'label' => $text + 'label' => $text, ]; if ($this->mandatory) { $option['mandatory'] = true; @@ -41,7 +41,7 @@ protected function getOption(): array if (!Input::isPost()) { $option['checked'] = false; } else { - $option['checked'] = (string)$this->varValue === (string)$value; + $option['checked'] = (string) $this->varValue === (string) $value; } return $option; @@ -52,14 +52,15 @@ public function getAttributes($arrStrip = []) if ($this->mandatory) { $this->arrAttributes['required'] = 'required'; } + return parent::getAttributes($arrStrip); } - protected function isValidOption($varInput): bool { // set arrOptions to make parent validation work $this->arrOptions = [$this->getOption()]; + return parent::isValidOption($varInput); } -} \ No newline at end of file +} diff --git a/src/HeimrichHannotFormFieldsCollectionBundle.php b/src/HeimrichHannotFormFieldsCollectionBundle.php index f86f57a..9b00af8 100644 --- a/src/HeimrichHannotFormFieldsCollectionBundle.php +++ b/src/HeimrichHannotFormFieldsCollectionBundle.php @@ -10,5 +10,4 @@ public function getPath(): string { return \dirname(__DIR__); } - -} \ No newline at end of file +} From 20922e7647cbf77ebebf09d7037e122509138801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:49:26 +0200 Subject: [PATCH 6/7] add workflow --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3df2a0b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI +on: [push] + +jobs: + phpstan: + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + + - name: Checkout + uses: actions/checkout@v6 + + - name: Install the dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: "--no-plugins" + + - name: PHPStan + run: vendor/bin/phpstan analyse -c phpstan.neon + + rector: + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + + - name: Checkout + uses: actions/checkout@v6 + + - name: Install the dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: "--no-plugins" + + - name: Rector + run: vendor/bin/rector --dry-run --no-progress-bar + + ecs: + name: ECS + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib + coverage: none + + - name: Checkout + uses: actions/checkout@v6 + with: + show-progress: false + + - name: Install the dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: "--no-plugins" + + - name: Run ECS + run: vendor/bin/ecs check --no-progress-bar From 8e611b5e79b58c50ed48fd5c8209d644d40bf6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6rner?= Date: Tue, 30 Jun 2026 11:50:18 +0200 Subject: [PATCH 7/7] fix workflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3df2a0b..a9211ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 - name: Checkout uses: actions/checkout@v6 @@ -27,7 +27,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 - name: Checkout uses: actions/checkout@v6 @@ -47,7 +47,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 extensions: dom, fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, pcre, pdo_mysql, zlib coverage: none