File tree Expand file tree Collapse file tree 4 files changed +51
-3
lines changed Expand file tree Collapse file tree 4 files changed +51
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ parameters:
10
10
paths:
11
11
- src
12
12
- tests
13
+ excludePaths:
14
+ analyse:
15
+ - tests/Fixtures/Compat
13
16
checkMissingCallableSignature: true
14
17
checkUninitializedProperties: true
15
18
checkTooWideReturnTypesInProtectedAndPublicMethods: true
@@ -29,6 +32,10 @@ parameters:
29
32
identifier: 'identical.alwaysFalse'
30
33
reportUnmatched: false
31
34
path: 'src/EntityPreloader.php'
35
+ -
36
+ identifier: shipmonk.defaultMatchArmWithEnum
37
+ reportUnmatched: false # only new dbal issue
38
+ path: 'src/EntityPreloader.php'
32
39
-
33
40
message: '#Result of \|\| is always false#'
34
41
identifier: 'booleanOr.alwaysFalse'
Original file line number Diff line number Diff line change @@ -457,14 +457,14 @@ private function loadEntitiesBy(
457
457
return $ queryBuilder ->getQuery ()->getResult ();
458
458
}
459
459
460
- private function deduceArrayParameterType (Type $ dbalType ): ? ArrayParameterType
460
+ private function deduceArrayParameterType (Type $ dbalType ): ArrayParameterType | int | null // @phpstan-ignore return.unusedType (old dbal compat)
461
461
{
462
462
return match ($ dbalType ->getBindingType ()) {
463
463
ParameterType::INTEGER => ArrayParameterType::INTEGER ,
464
464
ParameterType::STRING => ArrayParameterType::STRING ,
465
465
ParameterType::ASCII => ArrayParameterType::ASCII ,
466
466
ParameterType::BINARY => ArrayParameterType::BINARY ,
467
- default => null , // @phpstan-ignore shipmonk.defaultMatchArmWithEnum
467
+ default => null ,
468
468
};
469
469
}
470
470
Original file line number Diff line number Diff line change 6
6
use Doctrine \DBAL \Platforms \AbstractPlatform ;
7
7
use Doctrine \DBAL \Types \Type ;
8
8
use LogicException ;
9
+ use ShipMonkTests \DoctrineEntityPreloader \Fixtures \Compat \CompatibilityType ;
9
10
10
11
final class BinaryIdType extends Type
11
12
{
12
13
14
+ use CompatibilityType;
15
+
13
16
public const NAME = 'binary_id ' ;
14
17
15
18
public function convertToPHPValue (
@@ -60,7 +63,7 @@ public function getName(): string
60
63
return self ::NAME ;
61
64
}
62
65
63
- public function getBindingType (): ParameterType
66
+ public function doGetBindingType (): ParameterType | int // @phpstan-ignore return.unusedType (old dbal compat)
64
67
{
65
68
return ParameterType::BINARY ;
66
69
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace ShipMonkTests \DoctrineEntityPreloader \Fixtures \Compat ;
4
+
5
+ use Doctrine \DBAL \ParameterType ;
6
+ use function enum_exists ;
7
+
8
+ if (!enum_exists (ParameterType::class)) {
9
+ trait CompatibilityType
10
+ {
11
+
12
+ public function getBindingType (): int
13
+ {
14
+ return $ this ->doGetBindingType ();
15
+ }
16
+
17
+ private function doGetBindingType (): int |ParameterType
18
+ {
19
+ return parent ::getBindingType ();
20
+ }
21
+
22
+ }
23
+ } else {
24
+ trait CompatibilityType
25
+ {
26
+
27
+ public function getBindingType (): ParameterType
28
+ {
29
+ return $ this ->doGetBindingType ();
30
+ }
31
+
32
+ private function doGetBindingType (): int |ParameterType
33
+ {
34
+ return parent ::getBindingType ();
35
+ }
36
+
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments