Skip to content

Commit ef59520

Browse files
committed
Introduce phpstan-strict-rules
1 parent a232203 commit ef59520

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

phpstan.neon

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
includes:
22
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
3+
- vendor/phpstan/phpstan-strict-rules/rules.neon
34
parameters:
45
level: max
56
paths:
67
- %rootDir%/../../../src/
78
ignoreErrors:
89
-
910
path: %rootDir%/../../../src/GetPostDynamicFunctionReturnTypeExtension.php
10-
message: "#^Strict comparison using === between 'OBJECT'\\|PhpParser\\\\Node\\\\Expr and '(ARRAY_N|ARRAY_A)' will always evaluate to false\\.$#"
11+
message: "#^Strict comparison using === between 'OBJECT'\\|PhpParser\\\\Node\\\\Expr and '(ARRAY_N|ARRAY_A|OBJECT)' will always evaluate to false\\.$#"
12+
-
13+
path: %rootDir%/../../../src/GetPostDynamicFunctionReturnTypeExtension.php
14+
message: "#^Strict comparison using !== between PhpParser\\\\Node\\\\Expr and 'OBJECT' will always evaluate to true\\.$#"

src/Composer/FixWpStubs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ class FixWpStubs
1111
{
1212
const STUBSFILE = '/giacocorsiglia/wordpress-stubs/wordpress-stubs.php';
1313

14-
public static function php73Polyfill(Event $event)
14+
public static function php73Polyfill(Event $event): int
1515
{
1616
if (! class_exists('\Symfony\Polyfill\Php73\Php73')) {
17-
return;
17+
return 0;
1818
}
1919

2020
$io = $event->getIO();

src/WpThemeMagicPropertiesClassReflectionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function hasProperty(ClassReflection $classReflection, string $propertyNa
2323
if ($classReflection->getName() !== 'WP_Theme') {
2424
return false;
2525
}
26-
return in_array($propertyName, $this->properties);
26+
return in_array($propertyName, $this->properties, true);
2727
}
2828

2929
public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection {

0 commit comments

Comments
 (0)