Skip to content

Commit ba6f2ad

Browse files
committed
misc
1 parent 3339144 commit ba6f2ad

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
level: 8
77

88
errorFormat: symplify
9-
# reportUnmatchedIgnoredErrors: false
9+
reportUnmatchedIgnoredErrors: false
1010

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

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

Whitespace-only changes.

rules/DowngradePhp73/Rector/ConstFetch/DowngradePhp73JsonConstRector.php

Lines changed: 3 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;
@@ -154,8 +154,6 @@ private function refactorExpression(Expression $expression): ?array
154154

155155
// retrieve a `FuncCall`, if any, from the statement
156156
$funcCall = $this->resolveFuncCall($expression);
157-
158-
// Nothing to do if no `FuncCall` found
159157
if (! $funcCall instanceof FuncCall) {
160158
return null;
161159
}
@@ -203,8 +201,7 @@ private function hasConstFetchInArgs(array $args, string $constName): bool
203201
{
204202
foreach ($args as $arg) {
205203
$value = $arg->value;
206-
207-
if ($value instanceof ConstFetch && $this->getName($value) === $constName) {
204+
if ($value instanceof ConstFetch && $this->isName($value, $constName)) {
208205
return true;
209206
}
210207

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)