You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2026. It is now read-only.
Repository navigation
Commit 33d189f
Browse filesBrowse the repository at this point in the historyBrowse files
Deprecate package in favor of tomasvotruba/type-coverage (#78)
Rules were merged into tomasvotruba/type-coverage 2.3.0. Mark the package
abandoned, document how to switch, and drop the downgraded release build
for anywherephp/type-perfect.
> **This package is deprecated and no longer maintained.**
7
+
>
8
+
> Its rules have been merged into [tomasvotruba/type-coverage](https://github.com/TomasVotruba/type-coverage) since version 2.3.0. Use that package instead:
We use these sets to improve code quality of our clients' code beyond PHPStan features.
@@ -14,8 +26,55 @@ If you care about code quality and type safety, add these 10 rules to your CI.
14
26
15
27
<br>
16
28
29
+
## How to switch
30
+
31
+
### 1. Swap the package
32
+
33
+
```diff
34
+
"require-dev": {
35
+
- "rector/type-perfect": "^2.1"
36
+
+ "tomasvotruba/type-coverage": "^2.3"
37
+
}
38
+
```
39
+
40
+
Type Coverage requires PHP `^8.4` (Type Perfect required `^8.2`).
41
+
42
+
If you already use `tomasvotruba/type-coverage`, only remove `rector/type-perfect` — keeping both loads every rule twice.
43
+
44
+
### 2. Keep your `ignoreErrors` as they are
45
+
46
+
Rules keep the `Rector\TypePerfect\` namespace in Type Coverage, so existing ignore patterns and baselines still match. The extension is registered by [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer#usage), so no `includes` change is needed either.
47
+
48
+
### 3. Enable the rules that used to be on by default
49
+
50
+
`NoParamTypeRemovalRule`, `NoIssetOnObjectRule` and `NoEmptyOnObjectRule` ran right after install here. In Type Coverage they're opt-in like the rest, one parameter each:
51
+
52
+
```diff
53
+
parameters:
54
+
type_perfect:
55
+
narrow_param: true
56
+
narrow_return: true
57
+
no_mixed_property: true
58
+
no_mixed_caller: true
59
+
null_over_false: true
60
+
+ no_param_type_removal: true
61
+
+ no_isset_on_object: true
62
+
+ no_empty_on_object: true
63
+
```
64
+
65
+
Every other parameter name is unchanged.
66
+
67
+
### Not carried over
68
+
69
+
***`NoArrayAccessOnObjectRule`** — the `$object['key']` over `$object->getKey()` check is not part of Type Coverage. If you rely on it, pin `rector/type-perfect``2.2.0` next to Type Coverage and keep only that rule enabled.
70
+
* Two fixes released here after the merge are not in Type Coverage yet: the `NarrowPublicClassMethodParamTypeRule` generic-object false-positive ([#74](https://github.com/rectorphp/type-perfect/pull/74)) and the Symfony DomCrawler skip in `NoArrayAccessOnObjectRule` ([#77](https://github.com/rectorphp/type-perfect/pull/77)).
71
+
72
+
<br>
73
+
17
74
## Install
18
75
76
+
*This package is deprecated — install [tomasvotruba/type-coverage](https://github.com/TomasVotruba/type-coverage) instead. The docs below are kept as reference for the rules.*
0 commit comments