Skip to content

Commit 9deecd9

Browse files
authored
Merge branch 'main' into field-type-deprecated-translated-category
2 parents 249707a + 46d51ec commit 9deecd9

File tree

85 files changed

+1012
-1466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1012
-1466
lines changed

.circleci/config.yml

Lines changed: 0 additions & 148 deletions
This file was deleted.

.circleci/generate-local-config.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

.circleci/run-local-config.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/php.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ jobs:
4747
drupal:
4848
- "^10"
4949
include:
50-
- php-version: "8.1"
51-
drupal: "^9.0"
52-
experimental: false
5350
- php-version: "8.3"
5451
drupal: "11.x-dev"
5552
experimental: true
@@ -65,9 +62,6 @@ jobs:
6562
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, gd
6663
- name: "Set drupal/core to ${{ matrix.drupal }}"
6764
run: "composer require drupal/core-recommended:${{ matrix.drupal }} --with-all-dependencies --dev --no-update"
68-
- name: "Add phpspec/prophecy-phpunit"
69-
run: "composer require phpspec/prophecy-phpunit:^2 --dev --no-update"
70-
if: ${{ matrix.drupal == '^9.0' }}
7165
- name: "Install dependencies"
7266
uses: "ramsey/composer-install@v3"
7367
- name: "PHPUnit"
@@ -89,9 +83,6 @@ jobs:
8983
drupal:
9084
- "^10"
9185
include:
92-
- php-version: "8.1"
93-
drupal: "^9.0"
94-
experimental: false
9586
- php-version: "8.3"
9687
drupal: "11.x-dev"
9788
experimental: true
@@ -121,7 +112,7 @@ jobs:
121112
- name: "require phpstan-drupal"
122113
run: |
123114
cd ~/drupal
124-
COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/phpstan-drupal "${{ steps.branch_alias.outputs.VERSION_ALIAS }} as 1.2.99" phpstan/extension-installer --with-all-dependencies
115+
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev "phpstan/phpstan:^2.0" "phpstan/phpstan-phpunit:^2.0" mglaman/phpstan-drupal "${{ steps.branch_alias.outputs.VERSION_ALIAS }} as 2.99.99" phpstan/extension-installer --with-all-dependencies
125116
cp $GITHUB_WORKSPACE/tests/fixtures/config/drupal-phpstan.neon phpstan.neon
126117
- name: "Test core/install.php"
127118
run: |
@@ -165,9 +156,6 @@ jobs:
165156
drupal:
166157
- "^10"
167158
include:
168-
- php-version: "8.1"
169-
drupal: "^9.0"
170-
experimental: false
171159
- php-version: "8.3"
172160
drupal: "11.x-dev"
173161
experimental: true
@@ -245,15 +233,14 @@ jobs:
245233
cd drupal
246234
composer config repositories.0 composer https://packages.drupal.org/8
247235
composer config repositories.1 path $GITHUB_WORKSPACE
248-
249236
- name: "Install Drupal core dependencies"
250237
uses: "ramsey/composer-install@v3"
251238
with:
252239
working-directory: "${{ runner.temp }}/drupal"
253240
- name: "require phpstan-drupal"
254241
run: |
255242
cd ${{ runner.temp }}/drupal
256-
composer require --dev mglaman/phpstan-drupal "${{ steps.branch_alias.outputs.VERSION_ALIAS }} as 1.1.99" --with-all-dependencies
243+
composer require drupal/core-dev "phpstan/phpstan:^2.0" "phpstan/phpstan-phpunit:^2.0" mglaman/phpstan-drupal "${{ steps.branch_alias.outputs.VERSION_ALIAS }} as 2.99.99" phpstan/extension-installer --with-all-dependencies
257244
- name: "Check baseline"
258245
run: |
259246
cd ${{ runner.temp }}/drupal

.github/workflows/phpstan-dev.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ PHPStan is able to [discover symbols](https://phpstan.org/user-guide/discovering
88
by Composer. However, Drupal does not provide autoloading information for modules and themes. This project registers
99
those namespaces so that PHPStan can properly discover symbols in your Drupal code base automatically.
1010

11+
> [!NOTE]
12+
> With Drupal 11.2, Drupal core is now using PHPStan 2.0. The 1.x branch of phpstan-drupal will be supported until
13+
> 11.1 loses security support when 11.3 is released.
14+
1115
## Sponsors
1216

1317
<a href="https://www.undpaul.de/"><img src="https://www.undpaul.de/themes/custom/undpaul3/logo.svg" alt="undpaul" width="250" /></a> <a href="https://www.optasy.com/"><img src="https://optasy.com/themes/custom/optasy/img/logo_optasy.png" alt="Optasy" width="250"></a> <a href="https://www.fame.fi/"><img src="https://www.fame.fi/assets/images/fame-logo.png" alt="Fame Helsinki" width="250" ></a>

composer.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
],
1212
"require": {
1313
"php": "^8.1",
14-
"phpstan/phpstan": "^1.10.56",
15-
"phpstan/phpstan-deprecation-rules": "^1.1.4",
16-
"symfony/finder": "^4.2 || ^5.0 || ^6.0 || ^7.0",
17-
"symfony/yaml": "^4.2|| ^5.0 || ^6.0 || ^7.0",
14+
"phpstan/phpstan": "^2.1",
15+
"phpstan/phpstan-deprecation-rules": "^2.0",
16+
"symfony/finder": "^6.2 || ^7.0",
17+
"symfony/yaml": "^6.2 || ^7.0",
1818
"webflo/drupal-finder": "^1.3.1"
1919
},
2020
"require-dev": {
21-
"behat/mink": "^1.8",
21+
"behat/mink": "^1.10",
2222
"composer/installers": "^1.9",
2323
"drupal/core-recommended": "^10",
24-
"drush/drush": "^10.0 || ^11 || ^12 || ^13@beta",
25-
"phpstan/extension-installer": "^1.1",
26-
"phpstan/phpstan-strict-rules": "^1.0",
27-
"phpunit/phpunit": "^8.5 || ^9 || ^10 || ^11",
28-
"slevomat/coding-standard": "^7.1",
29-
"squizlabs/php_codesniffer": "^3.3",
30-
"symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.0 || ^7.0"
24+
"drush/drush": "^11 || ^12 || ^13",
25+
"phpstan/extension-installer": "^1.4.3",
26+
"phpstan/phpstan-strict-rules": "^2.0",
27+
"phpunit/phpunit": "^9 || ^10 || ^11",
28+
"slevomat/coding-standard": "^8.6",
29+
"squizlabs/php_codesniffer": "^3.7",
30+
"symfony/phpunit-bridge": "^6.2 || ^7.0"
3131
},
3232
"minimum-stability": "dev",
3333
"prefer-stable": true,
@@ -51,9 +51,6 @@
5151
]
5252
},
5353
"extra": {
54-
"branch-alias": {
55-
"dev-main": "1.0-dev"
56-
},
5754
"installer-paths": {
5855
"tests/fixtures/drupal/core": ["type:drupal-core"],
5956
"tests/fixtures/drupal/libraries/{$name}": ["type:drupal-library"],

extension.neon

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ parameters:
1616
scanFiles:
1717
- stubs/Twig/functions.stub
1818
drupal:
19-
drupal_root: ~
19+
drupal_root:
2020
bleedingEdge:
2121
checkDeprecatedHooksInApiFiles: false
2222
checkCoreDeprecatedHooksInApiFiles: false
@@ -26,6 +26,7 @@ parameters:
2626
dependencySerializationTraitPropertyRule: false
2727
accessResultConditionRule: false
2828
classExtendsInternalClassRule: true
29+
pluginManagerInspectionRule: false
2930
entityMapping:
3031
aggregator_feed:
3132
class: Drupal\aggregator\Entity\Feed
@@ -252,6 +253,7 @@ parametersSchema:
252253
dependencySerializationTraitPropertyRule: boolean()
253254
accessResultConditionRule: boolean()
254255
classExtendsInternalClassRule: boolean()
256+
pluginManagerInspectionRule: boolean()
255257
])
256258
entityMapping: arrayOf(anyOf(
257259
structure([
@@ -333,3 +335,7 @@ services:
333335
class: mglaman\PHPStanDrupal\DeprecatedScope\DeprecationHelperScope
334336
tags:
335337
- phpstan.deprecations.deprecatedScopeResolver
338+
-
339+
class: mglaman\PHPStanDrupal\Type\InspectorTypeExtension
340+
tags:
341+
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension

phpstan-baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ parameters:
3434
count: 1
3535
path: src/Drupal/DrupalAutoloader.php
3636

37-
-
38-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
39-
count: 1
40-
path: src/Rules/Deprecations/ConditionManagerCreateInstanceContextConfigurationRule.php
41-
42-
-
43-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantStringType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantStrings\\(\\) instead\\.$#"
44-
count: 1
45-
path: src/Rules/Deprecations/ConditionManagerCreateInstanceContextConfigurationRule.php
46-
4737
-
4838
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantStringType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantStrings\\(\\) instead\\.$#"
4939
count: 2

0 commit comments

Comments
 (0)