From cd1316c8d1145dd98b14eafd187fc5302c4392df Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Thu, 16 Oct 2025 16:16:23 +0200 Subject: [PATCH 1/9] NGSTACK-998 update to Ibexa 5 and add two bundles to 'required-dev' section --- composer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c3e9ddf..787c185 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,12 @@ } ], "require": { - "ibexa/core": "^4.0" + "ibexa/core": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^12.0", + "symfony/form": "^7.3", + "ibexa/content-forms": "^5.0" }, "minimum-stability": "dev", "prefer-stable": true, From b845918e34bb9fd85de72fc88d6865c0f37c5f77 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Thu, 16 Oct 2025 16:16:54 +0200 Subject: [PATCH 2/9] NGSTACK-998 migrate 'phpunit.xml' to newer version --- phpunit.xml | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 114cf2f..725bcc6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,10 +1,11 @@ - + @@ -12,16 +13,16 @@ Tests - - + + . - - DependencyInjection - Resources - Tests - vendor - NetgenContentTypeListBundle.php - - - + + + DependencyInjection + Resources + Tests + vendor + NetgenContentTypeListBundle.php + + From c20b3bf1d1ab7d77494211261ce597e1b8b2801b Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Thu, 16 Oct 2025 16:18:09 +0200 Subject: [PATCH 3/9] NGSTACK-998 make small changes to few classes for PHP 8.3 --- Core/FieldType/ContentTypeList/FormMapper.php | 6 +++--- Core/FieldType/ContentTypeList/Type.php | 2 +- Core/FieldType/ContentTypeList/Value.php | 12 +++--------- .../Converter/ContentTypeListConverter.php | 6 +++--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Core/FieldType/ContentTypeList/FormMapper.php b/Core/FieldType/ContentTypeList/FormMapper.php index e5a04f2..91fc8bd 100644 --- a/Core/FieldType/ContentTypeList/FormMapper.php +++ b/Core/FieldType/ContentTypeList/FormMapper.php @@ -20,9 +20,9 @@ public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): vo 'value', ContentTypeListFieldType::class, [ - 'required' => $data->fieldDefinition->isRequired, - 'label' => $data->fieldDefinition->getName(), - 'field_definition' => $data->fieldDefinition, + 'required' => $data->getFieldDefinition()->isRequired, + 'label' => $data->getFieldDefinition()->getName(), + 'field_definition' => $data->getFieldDefinition(), 'multiple' => true, ] ) diff --git a/Core/FieldType/ContentTypeList/Type.php b/Core/FieldType/ContentTypeList/Type.php index 3b60f3c..447d179 100644 --- a/Core/FieldType/ContentTypeList/Type.php +++ b/Core/FieldType/ContentTypeList/Type.php @@ -105,7 +105,7 @@ protected function checkValueStructure(BaseValue $value): void } } - protected function getSortInfo(BaseValue $value) + protected function getSortInfo(BaseValue $value): bool { return false; } diff --git a/Core/FieldType/ContentTypeList/Value.php b/Core/FieldType/ContentTypeList/Value.php index f55d7c7..74cb205 100644 --- a/Core/FieldType/ContentTypeList/Value.php +++ b/Core/FieldType/ContentTypeList/Value.php @@ -13,17 +13,11 @@ final class Value extends BaseValue /** * The list of content type identifiers. * - * @var string[] - */ - public array $identifiers = []; - - /** * @param string[] $identifiers */ - public function __construct(array $identifiers = []) - { - $this->identifiers = $identifiers; - } + public function __construct( + public array $identifiers = [], + ) {} public function __toString(): string { diff --git a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php index a3eb7f4..8e59ea4 100644 --- a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php +++ b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php @@ -12,7 +12,7 @@ use function explode; use function implode; -use function trim; +use function mb_trim; final class ContentTypeListConverter implements Converter { @@ -23,7 +23,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue): void { - $data = trim($value->dataText ?? ''); + $data = mb_trim($value->dataText ?? ''); $fieldValue->data = empty($data) ? [] : explode(',', $data); } @@ -31,7 +31,7 @@ public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageField public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef): void {} - public function getIndexColumn() + public function getIndexColumn(): bool { return false; } From ffb774336f2b19eada5f1a7909f640f51eada718 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Thu, 16 Oct 2025 16:18:31 +0200 Subject: [PATCH 4/9] NGSTACK-998 fix TypeTest --- Tests/Core/FieldType/ContentTypeList/TypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Core/FieldType/ContentTypeList/TypeTest.php b/Tests/Core/FieldType/ContentTypeList/TypeTest.php index b742d6d..0106e03 100644 --- a/Tests/Core/FieldType/ContentTypeList/TypeTest.php +++ b/Tests/Core/FieldType/ContentTypeList/TypeTest.php @@ -95,7 +95,7 @@ public function testAcceptValueWithArrayOfNumbers(): void public function testAcceptValueWithValueIdentifiersAsArrayOfNumbers(): void { $this->expectException(InvalidArgumentType::class); - $this->expectExceptionMessage("Argument '123' is invalid: value must be of type 'Netgen\\Bundle\\ContentTypeListBundle\\Core\\FieldType\\ContentTypeList\\Value', not 'integer'"); + $this->expectExceptionMessage("Argument '123' is invalid: value must be of type 'Netgen\\Bundle\\ContentTypeListBundle\\Core\\FieldType\\ContentTypeList\\Value', not 'int'"); $this->value->identifiers = [123, 456]; From 18fe9a02ed13c4005ada48d7c8a1b7100c963a6f Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Thu, 16 Oct 2025 16:20:41 +0200 Subject: [PATCH 5/9] NGSTACK-998 bump PHP version to 8.3 in tests workflow for GitHub --- .github/workflows/tests.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 258666f..908027f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,15 +15,10 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1'] - symfony: ['~5.4.0'] + php: ['8.3'] + symfony: ['~7.3.0'] phpunit: ['phpunit.xml'] deps: ['normal'] - include: - - php: '7.4' - symfony: '~5.4.0' - phpunit: 'phpunit.xml' - deps: 'low' steps: - uses: actions/checkout@v2 From 683f4bf2e23d32eef40efcc65db501f257de6a2a Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 20 Oct 2025 09:23:10 +0200 Subject: [PATCH 6/9] NGSTACK-998 use 'trim' instead of 'mb_trim' in ContentTypeListConverter class --- .../Content/FieldValue/Converter/ContentTypeListConverter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php index 8e59ea4..d344b60 100644 --- a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php +++ b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php @@ -12,7 +12,7 @@ use function explode; use function implode; -use function mb_trim; +use function trim; final class ContentTypeListConverter implements Converter { @@ -23,7 +23,7 @@ public function toStorageValue(FieldValue $value, StorageFieldValue $storageFiel public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue): void { - $data = mb_trim($value->dataText ?? ''); + $data = trim($value->dataText ?? ''); $fieldValue->data = empty($data) ? [] : explode(',', $data); } From 651c8e07400f86030d07a2c22b71b20542ef43a4 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Wed, 22 Oct 2025 09:17:04 +0200 Subject: [PATCH 7/9] NGSTACK-998 move 'symfony/form' bundle to 'require' section in composer.json file --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 787c185..547b9a6 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ } ], "require": { - "ibexa/core": "^5.0" + "ibexa/core": "^5.0", + "symfony/form": "^7.3" }, "require-dev": { "phpunit/phpunit": "^12.0", - "symfony/form": "^7.3", "ibexa/content-forms": "^5.0" }, "minimum-stability": "dev", From 2a595b9537d3d9c12bfd6fed0cf5b8b37f839ba7 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Fri, 24 Oct 2025 13:43:45 +0200 Subject: [PATCH 8/9] NGSTACK-998 comment 'mb_str_functions' option in '.php-cs-fixer' file --- .php-cs-fixer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 65608b9..67c96b2 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -32,7 +32,7 @@ 'import_functions' => true, ], 'list_syntax' => ['syntax' => 'short'], - 'mb_str_functions' => true, + // 'mb_str_functions' => true, 'native_constant_invocation' => true, 'nullable_type_declaration_for_default_null_value' => true, 'static_lambda' => true, From a7830d5634d23d97a4c8cf72d4d9dfac71ba1604 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Fri, 24 Oct 2025 14:02:18 +0200 Subject: [PATCH 9/9] NGSTACK-998 move 'ibexa/content-forms' bundle from 'require-dev' section into 'require' section of 'composer.json' file --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 547b9a6..7cbbe74 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ ], "require": { "ibexa/core": "^5.0", - "symfony/form": "^7.3" + "symfony/form": "^7.3", + "ibexa/content-forms": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^12.0", - "ibexa/content-forms": "^5.0" + "phpunit/phpunit": "^12.0" }, "minimum-stability": "dev", "prefer-stable": true,