@waynestate/pinstripe 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ Checks: `composer ci` (the same command runs on GitLab and GitHub).
|
|
|
22
22
|
Development happens on Wayne State's GitLab; this repository is a release mirror. Changes land there first.
|
|
23
23
|
|
|
24
24
|
Front page: [`site/index.html`](site/index.html), a static tailor's shop you can open in a browser or serve from `site/`.
|
|
25
|
+
On Citadel it is served by the raw-PHP deploy layer in [`deploy/`](deploy/): a SQUIRE kit whose front controller serves `site/` behind HELMET's security headers. For local development, keep serving `site/` directly.
|
|
25
26
|
|
|
26
27
|
<div align="center">
|
|
27
28
|
<img src="docs/readme/tape.svg" width="100%" alt="A yellow tape measure unrolls across a green card with seven marks, one per preset: The cut, Pint, presets per and laravel; The inseam, PHPStan, level 8; The lining, Larastan; The press, Rector, with dead code, code quality, type declarations and early return; The buttonholes, ESLint, javascript and typescript with vue and accessibility; The hem, Prettier, 100 columns, single quotes, semicolons, trailing commas; The chalk line, baseline.">
|
|
@@ -45,9 +46,11 @@ Front page: [`site/index.html`](site/index.html), a static tailor's shop you can
|
|
|
45
46
|
Add Pinstripe as a dev dependency:
|
|
46
47
|
|
|
47
48
|
```
|
|
48
|
-
composer require --dev waynestate/pinstripe
|
|
49
|
+
composer require --dev waynestate/pinstripe:^0.1
|
|
49
50
|
```
|
|
50
51
|
|
|
52
|
+
Pinstripe 0.1.0 is on Packagist, and the npm package, `@waynestate/pinstripe`, is at 0.1.0 too.
|
|
53
|
+
|
|
51
54
|
Point PHPStan at the raw config. `phpstan.neon`:
|
|
52
55
|
|
|
53
56
|
```neon
|
|
@@ -82,7 +85,7 @@ The tailor flags the old cut before the fabric is retired.
|
|
|
82
85
|
Same, with the Laravel parts:
|
|
83
86
|
|
|
84
87
|
```
|
|
85
|
-
composer require --dev waynestate/pinstripe larastan/larastan
|
|
88
|
+
composer require --dev waynestate/pinstripe:^0.1 larastan/larastan
|
|
86
89
|
```
|
|
87
90
|
|
|
88
91
|
Pinstripe pulls in `phpstan/extension-installer`, which registers Larastan for you. When Composer asks, allow the
|
|
@@ -162,7 +165,24 @@ alone. Rector is the tailor's press: it smooths old code to the standard without
|
|
|
162
165
|
|
|
163
166
|
## The strict cut
|
|
164
167
|
|
|
165
|
-
New apps can include `vendor/waynestate/pinstripe/phpstan/strict.neon` instead of `raw.neon` or `laravel.neon`. It keeps the base cut and turns on `phpstan/phpstan-strict-rules`, so loose comparisons like `==` fail the build. Existing apps stay on the base cut and baseline their way over.
|
|
168
|
+
New apps can include `vendor/waynestate/pinstripe/phpstan/strict.neon` instead of `raw.neon` or `laravel.neon`. It keeps the base cut and turns on `phpstan/phpstan-strict-rules`, so loose comparisons like `==` fail the build. Existing apps stay on the base cut and baseline their way over.
|
|
169
|
+
|
|
170
|
+
PHPStan checks phpdoc method signatures from level 3 up, and `phpstan/phpstan-strict-rules` forces the two switches behind them on for every run it is installed for. The base cut pins `reportMaybesInMethodSignatures` and `reportStaticMethodSignatures` off so it stays exactly as documented; the strict cut keeps them on, so it also reports maybe-mismatched overrides and static method overrides.
|
|
171
|
+
|
|
172
|
+
`phpstan/phpstan-strict-rules` forces eight more switches on for every run as well. Each one is decided below: low noise and real bugs stay on in every cut, noisy ones are pinned off in the base cut and turned on only in `strict.neon`.
|
|
173
|
+
|
|
174
|
+
| Parameter | Raw and Laravel cuts | Strict cut | Why |
|
|
175
|
+
|---|---|---|---|
|
|
176
|
+
| `checkExplicitMixedMissingReturn` | on | on | A function declared to return `mixed` that can fall off the end is a real bug, and rare in practice. |
|
|
177
|
+
| `checkFunctionNameCase` | on | on | A wrongly cased function name works on Windows and macOS and breaks on Linux. |
|
|
178
|
+
| `checkInternalClassCaseSensitivity` | on | on | The same case bug for PHP's own classes. |
|
|
179
|
+
| `checkStrictPrintfPlaceholderTypes` | on | on | `%d` fed a string is a real formatting bug, and rare. |
|
|
180
|
+
| `checkDynamicProperties` | off | on | Floods legacy code with undeclared properties. |
|
|
181
|
+
| `reportMaybesInPropertyPhpDocTypes` | off | on | Reports "maybe" phpdoc mismatches that legacy docblocks trip constantly. |
|
|
182
|
+
| `reportWrongPhpDocTypeInVarTag` | off | on | Old `@var` tags are often loose; fixing them is cleanup, not bug hunting. |
|
|
183
|
+
| `reportNonIntStringArrayKey` | off | on | Bleeding-edge check that is noisy on loosely keyed arrays. |
|
|
184
|
+
|
|
185
|
+
Strict is the tailor's chalk line drawn before the first stitch.
|
|
166
186
|
|
|
167
187
|
## Adopting on an existing app
|
|
168
188
|
|
|
@@ -203,6 +223,8 @@ gets longer.
|
|
|
203
223
|
|
|
204
224
|
## Tested with
|
|
205
225
|
|
|
226
|
+
Maintainers: how to build, test and release this project, and where its data comes from, is in [MAINTAINING.md](MAINTAINING.md).
|
|
227
|
+
|
|
206
228
|
- Pint 1.32.1
|
|
207
229
|
- PHPStan 2.3.3
|
|
208
230
|
- PHPStan extension-installer 1.4.3
|
package/package.json
CHANGED