Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions Core/FieldType/ContentTypeList/FormMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
)
Expand Down
2 changes: 1 addition & 1 deletion Core/FieldType/ContentTypeList/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected function checkValueStructure(BaseValue $value): void
}
}

protected function getSortInfo(BaseValue $value)
protected function getSortInfo(BaseValue $value): bool
{
return false;
}
Expand Down
12 changes: 3 additions & 9 deletions Core/FieldType/ContentTypeList/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Core/FieldType/ContentTypeList/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
35 changes: 18 additions & 17 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.4/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
backupGlobals="false"
failOnRisky="true"
failOnWarning="true"
beStrictAboutTestsThatDoNotTestAnything="false"
>
<testsuites>
<testsuite name="Netgen\ContentTypeList\Tests">
<directory>Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<source>
<include>
<directory>.</directory>
<exclude>
<directory>DependencyInjection</directory>
<directory>Resources</directory>
<directory>Tests</directory>
<directory>vendor</directory>
<file>NetgenContentTypeListBundle.php</file>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory>DependencyInjection</directory>
<directory>Resources</directory>
<directory>Tests</directory>
<directory>vendor</directory>
<file>NetgenContentTypeListBundle.php</file>
</exclude>
</source>
</phpunit>