Skip to content

Commit 7564c44

Browse files
authored
Merge pull request #106 from systopia/drupal-11
Add support for Drupal 11
2 parents 3abcca5 + 3c4dcee commit 7564c44

24 files changed

+39
-40
lines changed

.github/workflows/phpcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.2
19+
php-version: 8.4
2020
coverage: none
2121
tools: cs2pr
2222
env:

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
php-versions: ['7.4', '8.0', '8.2']
13+
php-versions: ['8.1', '8.4']
1414
prefer: ['prefer-stable', 'prefer-lowest']
1515
name: PHPStan with PHP ${{ matrix.php-versions }} ${{ matrix.prefer }}
1616

@@ -42,4 +42,4 @@ jobs:
4242
composer composer-phpstan -- update --no-progress --prefer-dist --optimize-autoloader
4343
4444
- name: Run PHPStan
45-
run: composer phpstan -- analyse -c phpstan.neon.dist
45+
run: composer phpstan -- analyze -c phpstan.ci.neon

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
}
3737
},
3838
"require": {
39-
"php": "^7.4 || ^8",
39+
"php": "^8.1",
4040
"systopia/expression-language-ext": "~0.1",
4141
"systopia/opis-json-schema-ext": "~0.2"
4242
},
4343
"require-dev": {
44-
"drupal/core": "^9.5 || ^10",
45-
"drupal/core-dev": "^9.5 || ^10"
44+
"drupal/core": "^10 || ^11",
45+
"drupal/core-dev": "^10 || ^11"
4646
},
4747
"scripts": {
4848
"composer-phpstan": [

json_forms.info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: JSONForms
22
type: module
33
description: Create a Drupal form from a JSONForms definition.
44
package: JSONForms
5-
core_version_requirement: ^9.5 || ^10
6-
php: 7.4
5+
core_version_requirement: ^10 || ^11
6+
php: 8.1
77
hidden: true
88
version: 0.7.1-dev
99
'interface translation project': json_forms

modules/json_forms_example/json_forms_example.info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: JSONForms example
22
type: module
33
description: Demonstrates how to use JSONForms.
44
package: JSONForms
5-
core_version_requirement: ^9.5 || ^10
6-
php: 7.4
5+
core_version_requirement: ^10 || ^11
6+
php: 8.1
77
dependencies:
88
- json_forms:json_forms
99
version: 0.7.1-dev

phpstan.ci.neon

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
includes:
2+
- phpstan.neon.dist
3+
4+
parameters:
5+
# Because we test with different versions in CI we have unmatched errors
6+
reportUnmatchedIgnoredErrors: false
7+
ignoreErrors:
8+
# Required for Drupal 10.
9+
- '#^Method Drupal\\Core\\Form\\FormBuilderInterface::getForm\(\) invoked with \d+ parameters, 1 required.$#'

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ parameters:
2424
# https://youtrack.jetbrains.com/issue/WI-63891/PHPStan-ignoreErrors-configuration-isnt-working-with-inspections
2525
# Wrong phpdoc type hint in Drupal
2626
- '/^Parameter #1 \$key of method Drupal\\Core\\Form\\FormStateInterface::hasTemporaryValue\(\) expects string, array<int\|string> given.$/'
27-
- '#^Method Drupal\\Core\\Form\\FormBuilderInterface::getForm\(\) invoked with \d+ parameters, 1 required.$#'
2827
-
2928
message: '#^Variable property access on mixed.$#'
3029
paths:

src/Form/AbstractJsonFormsForm.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ protected function buildJsonFormsForm(
108108
$formState->set('uiSchema', $uiSchema);
109109
$formState->set('recalculateOnChange', $recalculateOnChange);
110110

111+
// @phpstan-ignore equal.notAllowed
111112
if (new \stdClass() == $uiSchema) {
112113
return [];
113114
}

src/Form/Control/ArrayArrayFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public function createFormArray(
4949
FormArrayFactoryInterface $formArrayFactory
5050
): array {
5151
Assertion::isInstanceOf($definition, ControlDefinition::class);
52-
/** @var \Drupal\json_forms\JsonForms\Definition\Control\ControlDefinition $definition */
5352
$definition = ArrayControlDefinition::fromDefinition($definition);
54-
/** @var \Drupal\json_forms\JsonForms\Definition\Control\ArrayControlDefinition $definition */
5553

5654
$fieldsetWrapperId = 'array-wrapper-' . str_replace('.', '__', implode('_', $definition->getPropertyPath()));
5755
// phpcs:disable Drupal.Commenting.InlineComment.DocBlock

src/Form/Control/Callbacks/ArrayCallbacks.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public static function ajaxRemove(array &$form, FormStateInterface $formState):
102102
$propertyPath = $triggeringElement['#_controlPropertyPath'];
103103

104104
$arrayForm = &self::getArrayForm($form, $triggeringElement);
105+
// @phpstan-ignore argument.type
105106
FormValueAccessor::setValue($arrayForm['items'], $propertyPath, $formState->getTemporaryValue($propertyPath));
106107

107108
/** @var \Drupal\Core\Render\MainContent\AjaxRenderer $ajaxRenderer */

0 commit comments

Comments
 (0)