Skip to content

Commit 5b5cc77

Browse files
authored
Fix CS (#186)
* Fix CS * Fix PHP 7.2 compat.
1 parent 68cdfe3 commit 5b5cc77

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/GetPostsDynamicFunctionReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static function getIndeterminedType(): Type
9999
{
100100
return TypeCombinator::union(
101101
new ArrayType(new IntegerType(), new ObjectType(WP_Post::class)),
102-
new ArrayType(new IntegerType(), new IntegerType()),
102+
new ArrayType(new IntegerType(), new IntegerType())
103103
);
104104
}
105105
}

src/GetTermsDynamicFunctionReturnTypeExtension.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use PHPStan\Type\Accessory\AccessoryNumericStringType;
2121
use PHPStan\Type\Constant\ConstantStringType;
2222

23-
2423
class GetTermsDynamicFunctionReturnTypeExtension implements \PHPStan\Type\DynamicFunctionReturnTypeExtension
2524
{
2625
private const SUPPORTED_FUNCTIONS = [
@@ -40,6 +39,8 @@ public function isFunctionSupported(FunctionReflection $functionReflection): boo
4039
/**
4140
* @see https://developer.wordpress.org/reference/functions/get_terms/
4241
* @see https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
42+
*
43+
* phpcs:ignore NeutronStandard.Functions.LongFunction.LongFunction
4344
*/
4445
public function getTypeFromFunctionCall(FunctionReflection $functionReflection, FuncCall $functionCall, Scope $scope): Type
4546
{
@@ -48,10 +49,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
4849

4950
if ($argsParameterPosition === null) {
5051
throw new \PHPStan\ShouldNotHappenException(
51-
sprintf(
52-
'Could not detect parameter position for function %s()',
53-
$name
54-
)
52+
sprintf('Could not detect parameter position for function %s()', $name)
5553
);
5654
}
5755

0 commit comments

Comments
 (0)