@@ -49,22 +49,22 @@ public function it_returns_no_errors_for_valid_complex_data(): void
4949 public function it_returns_errors_for_invalid_scalar_data (): void
5050 {
5151 $ this ->analyse ([__DIR__ . '/../Samples/InvalidScalarSpatieLaravelData.php ' ], [
52- $ this ->expectError (21 , 'stringProperty ' , InvalidScalarSpatieLaravelData::class, 'string ' , 'null ' ),
53- $ this ->expectError (21 , 'intProperty ' , InvalidScalarSpatieLaravelData::class, 'int ' , 'float ' ),
54- $ this ->expectError (21 , 'booleanProperty ' , InvalidScalarSpatieLaravelData::class, 'bool ' , 'array ' ),
55- $ this ->expectError (21 , 'floatProperty ' , InvalidScalarSpatieLaravelData::class, 'float ' , 'string ' ),
52+ $ this ->expectError (19 , 'stringProperty ' , InvalidScalarSpatieLaravelData::class, 'string ' , 'null ' ),
53+ $ this ->expectError (19 , 'intProperty ' , InvalidScalarSpatieLaravelData::class, 'int ' , 'float ' ),
54+ $ this ->expectError (19 , 'booleanProperty ' , InvalidScalarSpatieLaravelData::class, 'bool ' , 'array ' ),
55+ $ this ->expectError (19 , 'floatProperty ' , InvalidScalarSpatieLaravelData::class, 'float ' , 'string ' ),
5656 ]);
5757 }
5858
5959 /** @test */
6060 public function it_returns_errors_for_invalid_complex_data (): void
6161 {
6262 $ this ->analyse ([__DIR__ . '/../Samples/InvalidComplexSpatieLaravelData.php ' ], [
63- $ this ->expectError (21 , 'nullableMarkStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'int ' ),
64- $ this ->expectError (21 , 'nullableTypeStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'float ' ),
65- $ this ->expectError (21 , 'nullableMarkStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'array ' ),
66- $ this ->expectError (21 , 'nullableTypeStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'array ' ),
67- $ this ->expectError (21 , 'intersectionProperty ' , InvalidComplexSpatieLaravelData::class, '\Spatie\LaravelData\Casts\Cast&\Stringable ' , 'stdClass ' ),
63+ $ this ->expectError (20 , 'nullableMarkStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'int ' ),
64+ $ this ->expectError (20 , 'nullableTypeStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'float ' ),
65+ $ this ->expectError (20 , 'nullableMarkStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'array ' ),
66+ $ this ->expectError (20 , 'nullableTypeStringProperty ' , InvalidComplexSpatieLaravelData::class, 'null|string ' , 'array ' ),
67+ $ this ->expectError (20 , 'intersectionProperty ' , InvalidComplexSpatieLaravelData::class, '\Spatie\LaravelData\Casts\Cast&\Stringable ' , 'stdClass ' ),
6868 ]);
6969 }
7070
@@ -91,6 +91,7 @@ private function expectError(int $line, string $property, string $class, string
9191 return [
9292 ValidTypeRule::getErrorMessage ($ property , $ class , $ expectedType , $ actualType ),
9393 $ line ,
94+ 'This is a custom CEGO rule, if you found a bug fix it in the cego/phpstan project ' ,
9495 ];
9596 }
9697}
0 commit comments