Skip to content

Commit dc3c36c

Browse files
authored
Bump dependencies (#17)
1 parent 0bdb3f2 commit dc3c36c

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

.github/workflows/phpunit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
php-version: [7.4, 8.4]
28+
php-version: [8.0, 8.4]
2929

3030
steps:
3131
- name: Check out the source code

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"homepage": "https://polylang.pro",
66
"type": "library",
77
"require": {
8-
"szepeviktor/phpstan-wordpress": "^1.0"
8+
"php": "^8.0",
9+
"szepeviktor/phpstan-wordpress": "^2.0",
10+
"wpsyntex/polylang-stubs": "dev-master"
911
},
1012
"require-dev": {
11-
"phpunit/phpunit": "^7 || ^9",
12-
"wpsyntex/polylang-stubs": "dev-master"
13+
"phpunit/phpunit": "^9"
1314
},
1415
"autoload": {
1516
"psr-4": {

src/GuessTypeFromSwitcherAttributes.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use PHPStan\Analyser\Scope;
99
use PHPStan\TrinaryLogic;
1010
use PHPStan\Type\Type;
11-
use PHPStan\Type\Constant\ConstantArrayType;
1211
use PHPStan\Type\Constant\ConstantStringType;
1312
use PHPStan\Type\IntersectionType;
1413
use PHPStan\Type\StringType;
@@ -28,7 +27,7 @@ private function guessType(Arg $args, Scope $scope) : Type
2827
$argsKeys = [];
2928
$argsValues = [];
3029

31-
if ($argsType instanceof ArrayType) {
30+
if ($argsType->isArray()->yes()) {
3231
$argsKeys = $argsType->getKeysArray();
3332
$argsValues = $argsType->getValuesArray();
3433
}
@@ -42,7 +41,7 @@ private function guessType(Arg $args, Scope $scope) : Type
4241
}
4342
}
4443

45-
if ($argsKeys instanceof ConstantArrayType) {
44+
if ($argsKeys->isConstantArray()->yes()) {
4645
foreach ($argsKeys->getValueTypes() as $index => $key) {
4746
if ($key->getValue() !== 'raw') {
4847
// Current argument is not 'raw' parameter.

src/ModelLanguagesGetListDynamicMethodReturnTypeExtension.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use PhpParser\Node\Expr\MethodCall;
1212
use PHPStan\Analyser\Scope;
1313
use PHPStan\Reflection\MethodReflection;
14-
use PHPStan\Type\Constant\ConstantArrayType;
1514
use PHPStan\Type\Constant\ConstantStringType;
1615
use PHPStan\Type\ArrayType;
1716
use PHPStan\Type\IntersectionType;
@@ -60,7 +59,7 @@ public function getTypeFromMethodCall( MethodReflection $methodReflection, Metho
6059

6160
$fieldsType = $type->getOffsetValueType( $fieldsInst );
6261

63-
if ( ! $fieldsType instanceof ConstantStringType ) {
62+
if ( $fieldsType->isString()->no() ) {
6463
// The 'field' argument is not a string.
6564
return new ArrayType( new IntegerType(), new ObjectType( PLL_Language::class ) );
6665
}
@@ -70,10 +69,10 @@ public function getTypeFromMethodCall( MethodReflection $methodReflection, Metho
7069
}
7170
}
7271

73-
if ( ! isset( $fieldsValue ) && $argumentType instanceof ArrayType ) {
72+
if ( ! isset( $fieldsValue ) && $argumentType->isArray()->yes() ) {
7473
$argumentKeys = $argumentType->getKeysArray();
7574

76-
if ( $argumentKeys instanceof ConstantArrayType ) {
75+
if ( $argumentKeys->isConstantArray()->yes() ) {
7776
$argumentKeysTypes = $argumentKeys->getValueTypes();
7877

7978
if( empty( $argumentKeysTypes ) ) {
@@ -88,7 +87,7 @@ public function getTypeFromMethodCall( MethodReflection $methodReflection, Metho
8887

8988
$fieldsType = $argumentType->getValuesArray()->getValueTypes()[ $index ];
9089

91-
if ( ! $fieldsType instanceof ConstantStringType ) {
90+
if ( $fieldsType->isString()->no() ) {
9291
// The 'field' argument is not a string.
9392
return new ArrayType( new IntegerType(), new ObjectType( PLL_Language::class ) );
9493
}

src/OptionsGetDynamicMethodReturnTypeExtension.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ public function getTypeFromMethodCall( MethodReflection $methodReflection, Metho
7575
case 'post_types':
7676
case 'sync':
7777
case 'taxonomies':
78-
$returnType[] = AccessoryArrayListType::intersectWith(
79-
new ArrayType(
80-
new IntegerType(),
81-
$this->getNonFalsyStringType()
82-
)
78+
$returnType[] = new ArrayType(
79+
new IntegerType(),
80+
$this->getNonFalsyStringType()
8381
);
8482
break;
8583

0 commit comments

Comments
 (0)