Skip to content

Commit 0a76b93

Browse files
authored
Merge pull request #5 from netgen/NGSTACK-998-upgrade-bundle-to-Ibexa-version-5
NGSTACK-998 upgrade bundle to ibexa version 5
2 parents 7ced2a5 + a7830d5 commit 0a76b93

File tree

9 files changed

+34
-42
lines changed

9 files changed

+34
-42
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php: ['7.4', '8.0', '8.1']
19-
symfony: ['~5.4.0']
18+
php: ['8.3']
19+
symfony: ['~7.3.0']
2020
phpunit: ['phpunit.xml']
2121
deps: ['normal']
22-
include:
23-
- php: '7.4'
24-
symfony: '~5.4.0'
25-
phpunit: 'phpunit.xml'
26-
deps: 'low'
2722

2823
steps:
2924
- uses: actions/checkout@v2

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'import_functions' => true,
3333
],
3434
'list_syntax' => ['syntax' => 'short'],
35-
'mb_str_functions' => true,
35+
// 'mb_str_functions' => true,
3636
'native_constant_invocation' => true,
3737
'nullable_type_declaration_for_default_null_value' => true,
3838
'static_lambda' => true,

Core/FieldType/ContentTypeList/FormMapper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): vo
2020
'value',
2121
ContentTypeListFieldType::class,
2222
[
23-
'required' => $data->fieldDefinition->isRequired,
24-
'label' => $data->fieldDefinition->getName(),
25-
'field_definition' => $data->fieldDefinition,
23+
'required' => $data->getFieldDefinition()->isRequired,
24+
'label' => $data->getFieldDefinition()->getName(),
25+
'field_definition' => $data->getFieldDefinition(),
2626
'multiple' => true,
2727
]
2828
)

Core/FieldType/ContentTypeList/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function checkValueStructure(BaseValue $value): void
105105
}
106106
}
107107

108-
protected function getSortInfo(BaseValue $value)
108+
protected function getSortInfo(BaseValue $value): bool
109109
{
110110
return false;
111111
}

Core/FieldType/ContentTypeList/Value.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@ final class Value extends BaseValue
1313
/**
1414
* The list of content type identifiers.
1515
*
16-
* @var string[]
17-
*/
18-
public array $identifiers = [];
19-
20-
/**
2116
* @param string[] $identifiers
2217
*/
23-
public function __construct(array $identifiers = [])
24-
{
25-
$this->identifiers = $identifiers;
26-
}
18+
public function __construct(
19+
public array $identifiers = [],
20+
) {}
2721

2822
public function __toString(): string
2923
{

Core/Persistence/Legacy/Content/FieldValue/Converter/ContentTypeListConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageField
3131

3232
public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef): void {}
3333

34-
public function getIndexColumn()
34+
public function getIndexColumn(): bool
3535
{
3636
return false;
3737
}

Tests/Core/FieldType/ContentTypeList/TypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testAcceptValueWithArrayOfNumbers(): void
9595
public function testAcceptValueWithValueIdentifiersAsArrayOfNumbers(): void
9696
{
9797
$this->expectException(InvalidArgumentType::class);
98-
$this->expectExceptionMessage("Argument '123' is invalid: value must be of type 'Netgen\\Bundle\\ContentTypeListBundle\\Core\\FieldType\\ContentTypeList\\Value', not 'integer'");
98+
$this->expectExceptionMessage("Argument '123' is invalid: value must be of type 'Netgen\\Bundle\\ContentTypeListBundle\\Core\\FieldType\\ContentTypeList\\Value', not 'int'");
9999

100100
$this->value->identifiers = [123, 456];
101101

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
}
1111
],
1212
"require": {
13-
"ibexa/core": "^4.0"
13+
"ibexa/core": "^5.0",
14+
"symfony/form": "^7.3",
15+
"ibexa/content-forms": "^5.0"
1416
},
1517
"require-dev": {
16-
"phpunit/phpunit": "^9.0"
18+
"phpunit/phpunit": "^12.0"
1719
},
1820
"minimum-stability": "dev",
1921
"prefer-stable": true,

phpunit.xml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
<phpunit bootstrap="vendor/autoload.php"
2-
backupGlobals="false"
3-
backupStaticAttributes="false"
4-
convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true"
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.4/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
75
colors="true"
6+
backupGlobals="false"
7+
failOnRisky="true"
8+
failOnWarning="true"
89
beStrictAboutTestsThatDoNotTestAnything="false"
910
>
1011
<testsuites>
1112
<testsuite name="Netgen\ContentTypeList\Tests">
1213
<directory>Tests</directory>
1314
</testsuite>
1415
</testsuites>
15-
<filter>
16-
<whitelist>
16+
<source>
17+
<include>
1718
<directory>.</directory>
18-
<exclude>
19-
<directory>DependencyInjection</directory>
20-
<directory>Resources</directory>
21-
<directory>Tests</directory>
22-
<directory>vendor</directory>
23-
<file>NetgenContentTypeListBundle.php</file>
24-
</exclude>
25-
</whitelist>
26-
</filter>
19+
</include>
20+
<exclude>
21+
<directory>DependencyInjection</directory>
22+
<directory>Resources</directory>
23+
<directory>Tests</directory>
24+
<directory>vendor</directory>
25+
<file>NetgenContentTypeListBundle.php</file>
26+
</exclude>
27+
</source>
2728
</phpunit>

0 commit comments

Comments
 (0)