Skip to content

Commit 3a038b0

Browse files
juliangutmremi
authored andcommitted
Increase upper limit requirement on phpstan (#21)
increase upper limit requirement on phpstan
1 parent d43b2e0 commit 3a038b0

File tree

8 files changed

+31
-9
lines changed

8 files changed

+31
-9
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ php:
88
- '7.1'
99
- '7.2'
1010
- '7.3'
11+
- '7.4'
1112

1213
env:
1314
global:
@@ -20,8 +21,6 @@ cache:
2021
directories:
2122
- $HOME/.composer/cache/files
2223

23-
before_install: composer self-update
24-
2524
before_install:
2625
- composer self-update
2726
- if [ -x .travis/before_install_${TARGET}.sh ]; then .travis/before_install_${TARGET}.sh; fi;
@@ -34,4 +33,3 @@ script:
3433

3534
after_success:
3635
- if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi;
37-

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ master
66

77
* todo...
88

9+
v0.3.0
10+
------
11+
12+
* Updated to PHPStan 0.12
13+
* Added testing on PHP 7.4
14+
915
v0.2.0
1016
------
1117

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ parameters:
3636
# enable detection of echo
3737
-
3838
type: Stmt_Echo
39+
functions: null
3940
4041
# enable detection of eval
4142
-
4243
type: Expr_Eval
44+
functions: null
4345
4446
# enable detection of die/exit
4547
-
4648
type: Expr_Exit
49+
functions: null
4750
4851
# enable detection of a set of functions
4952
-

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
],
1818
"require": {
1919
"php": "^7.1",
20-
"phpstan/phpstan": "^0.11"
20+
"phpstan/phpstan": "^0.12"
2121
},
2222
"require-dev": {
2323
"friendsofphp/php-cs-fixer": "^2.12",
2424
"localheinz/composer-normalize": "^1.3",
25-
"phpstan/phpstan-phpunit": "^0.11",
25+
"phpstan/phpstan-phpunit": "^0.12",
2626
"phpunit/phpunit": "^7.2",
2727
"sensiolabs/security-checker": "^5.0",
2828
"symfony/var-dumper": "^4.3"

extension.neon

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1+
parametersSchema:
2+
banned_code: structure([
3+
nodes: listOf(structure([
4+
type: string()
5+
functions: schema(listOf(string()), nullable())
6+
]))
7+
use_from_tests: bool()
8+
])
9+
110
parameters:
211
banned_code:
312
nodes:
413
# enable detection of echo
514
-
615
type: Stmt_Echo
16+
functions: null
717

818
# enable detection of eval
919
-
1020
type: Expr_Eval
21+
functions: null
1122

1223
# enable detection of die/exit
1324
-
1425
type: Expr_Exit
26+
functions: null
1527

1628
# enable detection of a set of functions
1729
-

phpstan.neon.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
parameters:
2+
checkGenericClassInNonGenericObjectType: false
3+
14
includes:
25
- extension.neon
36
- vendor/phpstan/phpstan-phpunit/extension.neon

src/Rules/BannedNodesRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
class BannedNodesRule implements Rule
2727
{
2828
/**
29-
* @var array
29+
* @var array<array<string, string[]>>
3030
*/
3131
private $bannedNodes;
3232

3333
/**
34-
* @param array $bannedNodes
34+
* @param array<array<string, string|string[]>> $bannedNodes
3535
*/
3636
public function __construct(array $bannedNodes)
3737
{

tests/Rules/BannedNodesRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ public function testProcessNodeWithHandledTypes(Expr $node): void
120120
}
121121

122122
/**
123-
* @return \Generator
123+
* @return \Generator<array<Include_>>
124124
*/
125125
public function getUnhandledNodes(): \Generator
126126
{
127127
yield [new Include_($this->createMock(Expr::class), Include_::TYPE_INCLUDE)];
128128
}
129129

130130
/**
131-
* @return \Generator
131+
* @return \Generator<array<Eval_|Exit_>>
132132
*/
133133
public function getHandledNodes(): \Generator
134134
{

0 commit comments

Comments
 (0)