Skip to content

Commit 3f8ab5c

Browse files
committed
misc
1 parent 76c5038 commit 3f8ab5c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ includes:
55
parameters:
66
level: 8
77
errorFormat: symplify
8-
# reportUnmatchedIgnoredErrors: false
8+
reportUnmatchedIgnoredErrors: false
99

1010
# see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
1111
typeAliases:

rules-tests/DowngradePhp80/Rector/MethodCall/DowngradeReflectionGetAttributesRector/Fixture/class_is_nullable.php

Whitespace-only changes.

rules/DowngradePhp73/Rector/ConstFetch/DowngradePhp73JsonConstRector.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ private function markConstantKnownInInnerStmts(If_ $if): void
118118
SimpleNodeTraverser::decorateWithAttributeValue($if, self::PHP73_JSON_CONSTANT_IS_KNOWN, true);
119119
}
120120

121-
private function resolveFuncCall(Expression $Expression): ?FuncCall
121+
private function resolveFuncCall(Expression $expression): ?FuncCall
122122
{
123-
$expr = $Expression->expr;
123+
$expr = $expression->expr;
124124
if ($expr instanceof Assign) {
125125
if ($expr->expr instanceof FuncCall) {
126126
return $expr->expr;
@@ -152,14 +152,15 @@ private function refactorExpression(Expression $expression): ?array
152152
return null;
153153
}
154154

155-
// retrieve a `FuncCall`, if any, from the statement
156155
$funcCall = $this->resolveFuncCall($expression);
157-
158-
// Nothing to do if no `FuncCall` found
159156
if (! $funcCall instanceof FuncCall) {
160157
return null;
161158
}
162159

160+
if ($funcCall->isFirstClassCallable()) {
161+
return null;
162+
}
163+
163164
// Nothing to do if not a refactored function
164165
if (! $this->isNames($funcCall, self::JSON_FUNCTIONS)) {
165166
return null;
@@ -203,7 +204,6 @@ private function hasConstFetchInArgs(array $args, string $constName): bool
203204
{
204205
foreach ($args as $arg) {
205206
$value = $arg->value;
206-
207207
if ($value instanceof ConstFetch && $this->getName($value) === $constName) {
208208
return true;
209209
}

tests/Issues/DowngradeNullJson/Fixture/fixture.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Fixture
2222
{
2323
public function run(?int $flags = null)
2424
{
25-
$flags = $flags ?? JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION;
25+
$flags = $flags ?? JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION | 0;
2626

2727
json_encode([], $flags);
2828
}

0 commit comments

Comments
 (0)