Skip to content

Commit 58ea6fb

Browse files
refactor: Improve ServiceMap configuration for application types (Base, Console, Web) (#45)
1 parent 4e5ae70 commit 58ea6fb

File tree

73 files changed

+1218
-1087
lines changed

Some content is hidden

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

73 files changed

+1218
-1087
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
secrets:
3636
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3737
with:
38-
concurrency-group: compatibility-${{ github.workflow }}-${{ github.ref }}
38+
concurrency-group: phpunit-compatibility-${{ github.workflow }}-${{ github.ref }}
3939
extensions: intl
4040
os: >-
4141
['ubuntu-latest', 'windows-latest']

.github/workflows/static.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ jobs:
2727
with:
2828
composer-command: |
2929
composer require yiisoft/yii2:22.0.x-dev --prefer-dist --no-progress --no-interaction --no-scripts --ansi
30+
concurrency-group: phpstan-${{ github.workflow }}-${{ github.ref }}
31+
os: >-
32+
['ubuntu-latest']
33+
php: >-
34+
['8.4']
35+
phpstan-console:
36+
uses: php-forge/actions/.github/workflows/phpstan.yml@main
37+
with:
38+
configuration: 'phpstan-console.neon'
39+
composer-command: |
40+
composer require yiisoft/yii2:22.0.x-dev --prefer-dist --no-progress --no-interaction --no-scripts --ansi
41+
concurrency-group: phpstan-console-${{ github.workflow }}-${{ github.ref }}
3042
os: >-
3143
['ubuntu-latest']
3244
php: >-

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Bug #42: Move `ApplicationPropertiesClassReflectionExtension` to `property` directory and add testing (@terabytesoftw)
1313
- Enh #43: Add tests for session property availability in `Console` and `Web` `Applications` (@terabytesoftw)
1414
- Bug #44: Move `UserPropertiesClassReflectionExtension` to `property` directory and add testing (@terabytesoftw)
15+
- Bug #45: Improve `ServiceMap` configuration for application types (`Base`, `Console`, `Web`) (@terabytesoftw)
1516

1617
## 0.2.3 June 09, 2025
1718

composer-require-checker.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"symbol-whitelist": [
33
"PHPStan\\Analyser\\OutOfClassScope",
44
"PHPStan\\Analyser\\Scope",
5+
"PHPStan\\PhpDoc\\StubFilesExtension",
56
"PHPStan\\Reflection\\Annotations\\AnnotationsPropertiesClassReflectionExtension",
67
"PHPStan\\Reflection\\ClassReflection",
78
"PHPStan\\Reflection\\Dummy\\DummyPropertyReflection",

extension.neon

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ services:
2929
-
3030
class: yii2\extensions\phpstan\property\UserPropertiesClassReflectionExtension
3131
tags: [phpstan.broker.propertiesClassReflectionExtension]
32-
-
33-
class: yii2\extensions\phpstan\reflection\RequestMethodsClassReflectionExtension
34-
tags: [phpstan.broker.methodsClassReflectionExtension]
35-
-
36-
class: yii2\extensions\phpstan\reflection\RequestPropertiesClassReflectionExtension
37-
tags: [phpstan.broker.propertiesClassReflectionExtension]
38-
-
39-
class: yii2\extensions\phpstan\reflection\ResponsePropertiesClassReflectionExtension
40-
tags: [phpstan.broker.propertiesClassReflectionExtension]
4132
-
4233
class: yii2\extensions\phpstan\type\ActiveQueryDynamicMethodReturnTypeExtension
4334
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
@@ -53,5 +44,9 @@ services:
5344
-
5445
class: yii2\extensions\phpstan\type\HeaderCollectionDynamicMethodReturnTypeExtension
5546
tags: [phpstan.broker.dynamicMethodReturnTypeExtension]
47+
-
48+
class: yii2\extensions\phpstan\StubFilesExtension
49+
tags:
50+
- phpstan.stubFilesExtension
5651

5752
- yii2\extensions\phpstan\ServiceMap(%yii2.config_path%)

phpstan-console.neon

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
includes:
2+
- extension.neon
3+
- phar://phpstan.phar/conf/bleedingEdge.neon
4+
- vendor/phpstan/phpstan-strict-rules/rules.neon
5+
6+
parameters:
7+
bootstrapFiles:
8+
- tests/bootstrap.php
9+
10+
ignoreErrors:
11+
- '#Calling PHPStan\\Reflection\\Annotations\\AnnotationsPropertiesClassReflectionExtension\:\:(has|get)Property\(\) is not covered.+#'
12+
- '#Creating new PHPStan\\Reflection\\Dummy\\DummyPropertyReflection is not covered.+#'
13+
14+
level: max
15+
16+
paths:
17+
- src
18+
- tests/console
19+
20+
# Enable strict advanced checks
21+
checkImplicitMixed: true
22+
checkBenevolentUnionTypes: true
23+
checkUninitializedProperties: true
24+
checkMissingCallableSignature: true
25+
checkTooWideReturnTypesInProtectedAndPublicMethods: true
26+
reportAnyTypeWideningInVarTag: true
27+
reportPossiblyNonexistentConstantArrayOffset: true
28+
reportPossiblyNonexistentGeneralArrayOffset: true
29+
30+
yii2:
31+
config_path: tests/console/config/config.php

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ parameters:
1515

1616
paths:
1717
- src
18-
- tests
18+
- tests/web
1919

2020
# Enable strict advanced checks
2121
checkImplicitMixed: true
@@ -28,4 +28,4 @@ parameters:
2828
reportPossiblyNonexistentGeneralArrayOffset: true
2929

3030
yii2:
31-
config_path: tests/fixture/config/config.php
31+
config_path: tests/config/config.php

0 commit comments

Comments
 (0)