Skip to content

Commit 3dcf471

Browse files
staabmclxmstaab
andauthored
support phpstan extension-installer (#74)
Co-authored-by: Markus Staab <[email protected]>
1 parent 81338e4 commit 3dcf471

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ indent_size = 2
1818

1919
[composer.json]
2020
indent_size = 4
21+
indent_style = tab

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ see the ['Files Changed' tab of the DEMO-PR](https://github.com/staabm/phpstan-d
2626

2727
To get the extension running you need to configure the `phpstan-dba`.
2828

29-
1. [Include](https://phpstan.org/config-reference#multiple-files) the [`dba.neon`](https://github.com/staabm/phpstan-dba/blob/main/config/dba.neon) from within your PHPStan configuration.
29+
1. If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) proceed with step 2.
30+
<details>
31+
<summary>Manual installation</summary>
32+
33+
If you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:
34+
35+
```
36+
includes:
37+
- vendor/staabm/phpstan-dba/config/dba.neon
38+
```
39+
</details>
3040

3141
2. Additionally your `bootstrap` file needs to be [configured within your phpstan configuration](https://phpstan.org/config-reference#bootstrap), so it will be automatically included by PHPStan:
3242

@@ -141,7 +151,6 @@ composer require --dev staabm/phpstan-dba
141151

142152
## Todos
143153

144-
- support the [phpstan/extension-installer](https://github.com/phpstan/extension-installer)
145154
- support [more mysql to PHPStan type mappings](https://github.com/staabm/phpstan-dba/blob/b868f40c80afcecd3de408df3801b5a24e220dd8/src/QueryReflection/MysqliQueryReflector.php#L111)
146155
- cover more real world examples and fine tune the [QueryReflection classes](https://github.com/staabm/phpstan-dba/tree/main/src/QueryReflection)
147156
- support a PDO based `QueryReflector`

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "staabm/phpstan-dba",
3+
"type": "phpstan-extension",
34
"license": "MIT",
45
"require": {
56
"php": "^8.0",
@@ -41,5 +42,12 @@
4142
},
4243
"config": {
4344
"sort-packages": true
45+
},
46+
"extra": {
47+
"phpstan": {
48+
"includes": [
49+
"config/dba.neon"
50+
]
51+
}
4452
}
4553
}

0 commit comments

Comments
 (0)