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 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, 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..d344b60 100644 --- a/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php +++ b/Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php @@ -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; } 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]; diff --git a/composer.json b/composer.json index c3e9ddf..7cbbe74 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,12 @@ } ], "require": { - "ibexa/core": "^4.0" + "ibexa/core": "^5.0", + "symfony/form": "^7.3", + "ibexa/content-forms": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^12.0" }, "minimum-stability": "dev", "prefer-stable": true, 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 + +