mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Be strict about matching word boundaries for expected messages
E.g. don't allow InvalidPropertyAssignmentValue where InvalidPropertyAssignment was expected
This commit is contained in:
parent
43e8703a2e
commit
d688b51534
@ -450,7 +450,7 @@ class AnnotationTest extends TestCase
|
||||
|
||||
$a = new A();
|
||||
$a->foo = 5;',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
'propertyWriteDocblockInvalidAssignment' => [
|
||||
'<?php
|
||||
@ -471,7 +471,7 @@ class AnnotationTest extends TestCase
|
||||
|
||||
$a = new A();
|
||||
$a->foo = 5;',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
'propertySealedDocblockUndefinedPropertyAssignment' => [
|
||||
'<?php
|
||||
@ -515,7 +515,7 @@ class AnnotationTest extends TestCase
|
||||
|
||||
$a = new A();
|
||||
$a->foo = 5;',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
'propertyReadInvalidFetch' => [
|
||||
'<?php
|
||||
@ -664,7 +664,7 @@ class AnnotationTest extends TestCase
|
||||
$this->foo["boof"] = "hello";
|
||||
}
|
||||
}',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
'incorrectDocblockOrder' => [
|
||||
'<?php
|
||||
|
@ -819,7 +819,7 @@ class ArrayAssignmentTest extends TestCase
|
||||
$this->strs = [new stdClass()]; // no issue emitted
|
||||
}
|
||||
}',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
'incrementalArrayPropertyAssignment' => [
|
||||
'<?php
|
||||
@ -832,7 +832,7 @@ class ArrayAssignmentTest extends TestCase
|
||||
$this->strs[] = new stdClass(); // no issue emitted
|
||||
}
|
||||
}',
|
||||
'error_message' => 'InvalidPropertyAssignment',
|
||||
'error_message' => 'InvalidPropertyAssignmentValue',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ class MethodSignatureTest extends TestCase
|
||||
}
|
||||
}',
|
||||
'error_message' => 'Argument 1 of B::fooFoo has wrong type \'bool\', expecting \'int\' as defined ' .
|
||||
'by A::foo',
|
||||
'by A::fooFoo',
|
||||
],
|
||||
'nonNullableSubclassParam' => [
|
||||
'<?php
|
||||
@ -236,7 +236,7 @@ class MethodSignatureTest extends TestCase
|
||||
return $s;
|
||||
}
|
||||
}',
|
||||
'error_message' => 'Argument 1 of B::foo has wrong type \'string\', expecting \'string|null\'',
|
||||
'error_message' => 'Argument 1 of B::foo has wrong type \'string\', expecting \'string|null\' as',
|
||||
],
|
||||
'mismatchingCovariantReturn' => [
|
||||
'<?php
|
||||
|
Loading…
Reference in New Issue
Block a user