Skip to content

Commit 811875c

Browse files
Added rules for protected properites and constants
1 parent 4b11c1e commit 811875c

File tree

16 files changed

+2386
-0
lines changed

16 files changed

+2386
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor/
2+
/.idea/
3+
/.phpunit.cache/

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
# phpstan-rules
22
Set of additional PHPStan rules
3+
4+
5+
TODO
6+
- duplicated array keys
7+
- foreach key value used outside or name duplicated
8+
- remove concat cast
9+
10+
-if (empty($values)) {
11+
+if ([] === $values) {
12+
13+
14+
-array_search("searching", $array) !== false;
15+
+in_array("searching", $array);

composer.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "pmarki/phpstan-rules",
3+
"type": "phpstan-extension",
4+
"description": "Set of additional PHPStan rules",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Piotr Markiewicz",
9+
"email": "email@markiewicz.xyz"
10+
}
11+
],
12+
"keywords": [
13+
"static analysis"
14+
],
15+
"extra": {
16+
"phpstan": {
17+
"includes": [
18+
"extension.neon"
19+
]
20+
}
21+
},
22+
"require": {
23+
"php": "^8.2",
24+
"phpstan/phpstan": "^1.12.6 || ^2.0"
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "^10.1 || ^11.0 || ^12.0",
28+
"symplify/easy-coding-standard": "^12.5"
29+
},
30+
"autoload": {
31+
"psr-4": {"PMarki\\PHPStanRules\\": "src"}
32+
},
33+
"autoload-dev": {
34+
"psr-4": {"PMarki\\PHPStanRules\\Tests\\": "tests"},
35+
"classmap": ["tests/fixtures"]
36+
},
37+
"scripts": {
38+
"phpstan": "vendor/bin/phpstan --ansi analyse --configuration phpstan.neon",
39+
"test": "vendor/bin/phpunit --colors=always"
40+
},
41+
"config": {
42+
"allow-plugins": {
43+
"dealerdirect/phpcodesniffer-composer-installer": true
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)