Skip to content

Commit 384cb77

Browse files
staabmclxmstaab
andauthored
Fix RecordingQueryReflector to work phpstan and phpunit in tandem (#82)
Co-authored-by: Markus Staab <[email protected]>
1 parent 9017835 commit 384cb77

File tree

3 files changed

+1580
-15
lines changed

3 files changed

+1580
-15
lines changed

.phpstan-dba.cache

Lines changed: 154 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
'message' => 'Unknown column \'doesNotExist\' in \'group statement\'',
1010
'code' => 1054,
1111
)),
12+
'result' =>
13+
array (
14+
1 => NULL,
15+
),
1216
),
1317
'SELECT * FROM ada ORDER BY doesNotExist' =>
1418
array (
@@ -17,6 +21,10 @@
1721
'message' => 'Unknown column \'doesNotExist\' in \'order clause\'',
1822
'code' => 1054,
1923
)),
24+
'result' =>
25+
array (
26+
1 => NULL,
27+
),
2028
),
2129
'SELECT * FROM ada WHERE doesNotExist=1' =>
2230
array (
@@ -25,6 +33,10 @@
2533
'message' => 'Unknown column \'doesNotExist\' in \'where clause\'',
2634
'code' => 1054,
2735
)),
36+
'result' =>
37+
array (
38+
1 => NULL,
39+
),
2840
),
2941
'SELECT * FROM unknownTable' =>
3042
array (
@@ -33,6 +45,10 @@
3345
'message' => 'Table \'phpstan_dba.unknownTable\' doesn\'t exist',
3446
'code' => 1146,
3547
)),
48+
'result' =>
49+
array (
50+
1 => NULL,
51+
),
3652
),
3753
'SELECT akid FROM ak WHERE eadavk>1.0' =>
3854
array (
@@ -123,6 +139,10 @@
123139
'message' => 'Unknown column \'doesNotExist\' in \'field list\'',
124140
'code' => 1054,
125141
)),
142+
'result' =>
143+
array (
144+
1 => NULL,
145+
),
126146
),
127147
'SELECT eladaid FROM ak' =>
128148
array (
@@ -193,6 +213,8 @@
193213
'result' =>
194214
array (
195215
1 => NULL,
216+
2 => NULL,
217+
3 => NULL,
196218
),
197219
),
198220
'SELECT email, adaid FROM ada' =>
@@ -594,6 +616,30 @@
594616
)),
595617
),
596618
),
619+
'SELECT email, adaid FROM ada WHERE adaid = 1 and email = :email' =>
620+
array (
621+
'error' =>
622+
staabm\PHPStanDba\Error::__set_state(array(
623+
'message' => 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \':email LIMIT 0\' at line 1',
624+
'code' => 1064,
625+
)),
626+
'result' =>
627+
array (
628+
3 => NULL,
629+
),
630+
),
631+
'SELECT email, adaid FROM ada WHERE adaid = 1 and email = ?' =>
632+
array (
633+
'error' =>
634+
staabm\PHPStanDba\Error::__set_state(array(
635+
'message' => 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'? LIMIT 0\' at line 1',
636+
'code' => 1064,
637+
)),
638+
'result' =>
639+
array (
640+
3 => NULL,
641+
),
642+
),
597643
'SELECT email, adaid FROM ada WHERE adaid = :adaid' =>
598644
array (
599645
'error' =>
@@ -606,6 +652,30 @@
606652
3 => NULL,
607653
),
608654
),
655+
'SELECT email, adaid FROM ada WHERE adaid = :adaid and email = \'[email protected]\'' =>
656+
array (
657+
'error' =>
658+
staabm\PHPStanDba\Error::__set_state(array(
659+
'message' => 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \':adaid and email = \'[email protected]\' LIMIT 0\' at line 1',
660+
'code' => 1064,
661+
)),
662+
'result' =>
663+
array (
664+
3 => NULL,
665+
),
666+
),
667+
'SELECT email, adaid FROM ada WHERE adaid = :adaid and email = :email' =>
668+
array (
669+
'error' =>
670+
staabm\PHPStanDba\Error::__set_state(array(
671+
'message' => 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \':adaid and email = :email LIMIT 0\' at line 1',
672+
'code' => 1064,
673+
)),
674+
'result' =>
675+
array (
676+
3 => NULL,
677+
),
678+
),
609679
'SELECT email, adaid FROM ada WHERE adaid = ?' =>
610680
array (
611681
'error' =>
@@ -909,10 +979,6 @@
909979
3 => NULL,
910980
),
911981
),
912-
'SELECT email, adaid FROM ada WHERE gesperrt = 1' =>
913-
array (
914-
'error' => NULL,
915-
),
916982
'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada' =>
917983
array (
918984
'error' => NULL,
@@ -1010,6 +1076,90 @@
10101076
array (
10111077
),
10121078
)),
1079+
2 =>
1080+
PHPStan\Type\Constant\ConstantArrayType::__set_state(array(
1081+
'keyType' =>
1082+
PHPStan\Type\UnionType::__set_state(array(
1083+
'types' =>
1084+
array (
1085+
0 =>
1086+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1087+
'value' => 0,
1088+
)),
1089+
1 =>
1090+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1091+
'value' => 1,
1092+
)),
1093+
2 =>
1094+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1095+
'value' => 2,
1096+
)),
1097+
3 =>
1098+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1099+
'value' => 3,
1100+
)),
1101+
),
1102+
)),
1103+
'itemType' =>
1104+
PHPStan\Type\UnionType::__set_state(array(
1105+
'types' =>
1106+
array (
1107+
0 =>
1108+
PHPStan\Type\IntegerRangeType::__set_state(array(
1109+
'min' => -128,
1110+
'max' => 4294967295,
1111+
)),
1112+
1 =>
1113+
PHPStan\Type\StringType::__set_state(array(
1114+
)),
1115+
),
1116+
)),
1117+
'allArrays' => NULL,
1118+
'keyTypes' =>
1119+
array (
1120+
0 =>
1121+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1122+
'value' => 0,
1123+
)),
1124+
1 =>
1125+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1126+
'value' => 1,
1127+
)),
1128+
2 =>
1129+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1130+
'value' => 2,
1131+
)),
1132+
3 =>
1133+
PHPStan\Type\Constant\ConstantIntegerType::__set_state(array(
1134+
'value' => 3,
1135+
)),
1136+
),
1137+
'valueTypes' =>
1138+
array (
1139+
0 =>
1140+
PHPStan\Type\StringType::__set_state(array(
1141+
)),
1142+
1 =>
1143+
PHPStan\Type\IntegerRangeType::__set_state(array(
1144+
'min' => 0,
1145+
'max' => 4294967295,
1146+
)),
1147+
2 =>
1148+
PHPStan\Type\IntegerRangeType::__set_state(array(
1149+
'min' => -128,
1150+
'max' => 127,
1151+
)),
1152+
3 =>
1153+
PHPStan\Type\IntegerRangeType::__set_state(array(
1154+
'min' => -128,
1155+
'max' => 127,
1156+
)),
1157+
),
1158+
'nextAutoIndex' => 4,
1159+
'optionalKeys' =>
1160+
array (
1161+
),
1162+
)),
10131163
),
10141164
),
10151165
'SELECT email, adaid, gesperrt, freigabe1u1 FROM ada LIMIT 1' =>

0 commit comments

Comments
 (0)