Skip to content

Commit f45d816

Browse files
authored
handle optional dependencies in build step (#545)
1 parent dd1a4e7 commit f45d816

File tree

4 files changed

+129
-59
lines changed

4 files changed

+129
-59
lines changed

composer.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"vendor/bin/ecs --ansi --fix"
5151
],
5252
"test": [
53+
"@build",
5354
"@putenv DBA_REFLECTOR=mysqli",
5455
"@phpunit",
5556
"@phpstan",
@@ -58,9 +59,11 @@
5859
"@phpunit",
5960
"@phpstan",
6061

61-
"@csfix"
62+
"@csfix",
63+
"@clean"
6264
],
6365
"record": [
66+
"@build",
6467
"phpstan clear-result-cache",
6568
"@putenv DBA_MODE=recording",
6669

@@ -72,7 +75,8 @@
7275
"@phpunit",
7376
"@phpstan",
7477

75-
"@csfix"
78+
"@csfix",
79+
"@clean"
7680
],
7781
"phpstan": [
7882
"phpstan analyse -c phpstan.neon.dist",
@@ -83,14 +87,24 @@
8387
"phpstan analyse -c tests/defaultFetchNumeric/config/phpstan.neon.dist"
8488
],
8589
"phpstan-baseline": [
86-
"phpstan analyse -c phpstan.neon.dist --generate-baseline"
90+
"@build",
91+
"phpstan analyse -c phpstan.neon.dist --generate-baseline",
92+
"@clean"
8793
],
8894
"phpunit": [
8995
"phpunit -c tests/default/config/phpunit.xml",
9096
"phpunit -c tests/rules/config/phpunit.xml",
9197
"phpunit -c tests/stringify/config/phpunit.xml",
9298
"phpunit -c tests/defaultFetchAssoc/config/phpunit.xml",
9399
"phpunit -c tests/defaultFetchNumeric/config/phpunit.xml"
100+
],
101+
"build": [
102+
"composer require sqlftw/sqlftw --ignore-platform-req=php+",
103+
"composer require doctrine/dbal --ignore-platform-req=php+"
104+
],
105+
"clean": [
106+
"composer remove sqlftw/sqlftw --ignore-platform-req=php+",
107+
"composer remove doctrine/dbal --ignore-platform-req=php+"
94108
]
95109
},
96110
"config": {

phpstan-baseline.neon

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ parameters:
2525
count: 1
2626
path: src/DoctrineReflection/DoctrineReflection.php
2727

28-
-
29-
message: "#^Class Doctrine\\\\DBAL\\\\Result not found\\.$#"
30-
count: 1
31-
path: src/DoctrineReflection/DoctrineResultObjectType.php
32-
33-
-
34-
message: "#^Class Doctrine\\\\DBAL\\\\Statement not found\\.$#"
35-
count: 1
36-
path: src/DoctrineReflection/DoctrineStatementObjectType.php
37-
3828
-
3929
message: """
4030
#^Call to deprecated method resolveQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
@@ -53,41 +43,11 @@ parameters:
5343
count: 2
5444
path: src/Extensions/DibiConnectionFetchDynamicReturnTypeExtension.php
5545

56-
-
57-
message: "#^Class Doctrine\\\\DBAL\\\\Connection not found\\.$#"
58-
count: 1
59-
path: src/Extensions/DoctrineConnectionExecuteQueryDynamicReturnTypeExtension.php
60-
61-
-
62-
message: "#^Class Doctrine\\\\DBAL\\\\Connection not found\\.$#"
63-
count: 1
64-
path: src/Extensions/DoctrineConnectionFetchDynamicReturnTypeExtension.php
65-
66-
-
67-
message: "#^Class Doctrine\\\\DBAL\\\\Connection not found\\.$#"
68-
count: 1
69-
path: src/Extensions/DoctrineConnectionPrepareDynamicReturnTypeExtension.php
70-
71-
-
72-
message: "#^Class Doctrine\\\\DBAL\\\\Connection not found\\.$#"
73-
count: 1
74-
path: src/Extensions/DoctrineConnectionQueryDynamicReturnTypeExtension.php
75-
76-
-
77-
message: "#^Class Doctrine\\\\DBAL\\\\Result not found\\.$#"
78-
count: 1
79-
path: src/Extensions/DoctrineResultDynamicReturnTypeExtension.php
80-
8146
-
8247
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
8348
count: 1
8449
path: src/Extensions/DoctrineResultDynamicReturnTypeExtension.php
8550

86-
-
87-
message: "#^Class Doctrine\\\\DBAL\\\\Statement not found\\.$#"
88-
count: 1
89-
path: src/Extensions/DoctrineStatementExecuteDynamicReturnTypeExtension.php
90-
9151
-
9252
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
9353
count: 1

tests/default/config/.phpunit-phpstan-dba-mysqli.cache

Lines changed: 56 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/default/config/.phpunit-phpstan-dba-pdo-mysql.cache

Lines changed: 56 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)