Matthew Brown
cc7ff94f7c
Prevent crash when method being called does not exist in reflection
...
Crash seen when running this test in PHP 7.4 because the method does not exist, but the call map includes it in 8.0
2021-05-13 12:40:39 -04:00
Bruce Weirdan
105c6f3a1c
Remove (and prevent) unused uses ( #5704 )
...
* Updates `slevomat/coding-standard`
* Removes unused uses
* Prevents unused uses
* Fixes a number of symbol case mismatches
2021-05-03 17:22:15 -04:00
Matt Brown
61478bb003
Use generics to allow property subclassing
...
cc @bdsl
2021-02-09 11:40:52 -05:00
Barney Laurance
509aadc08a
Remove all (but one) properity declarations that needed NonInvariantDocblockPropertyType suppressed ( #5174 )
...
The remaining property
\Psalm\Internal\Analyzer\NamespaceAnalyzer::$source seems a bit harder
to fix
2021-02-08 09:36:42 -05:00
Matt Brown
f2d202e2bb
Add less severe issue for docblock property type invariance cc @bdsl
...
This is less likely to break everything
2021-02-07 00:52:29 -05:00
Barney Laurance
0cd5442c47
Enforce property type invariance ( #5131 )
...
* Implement NonInvariantChildProperty detection
See https://github.com/vimeo/psalm/issues/4184
* Delete test cases with 'parentSetsWiderTypeInConstructor'
As I understand it these are not valid test cases. They
emit NonInvariantPropertyType issues which seems correct - the property
type variation is I think a latent bug in the sample code.
* Reduce shortcode for NonInvariantPropertyType to 1+max used shortcode on master
2021-01-31 11:32:24 -05:00
orklah
37a2f8a33d
unused use statements ( #4228 )
2020-09-22 01:10:46 -04:00
orklah
8c7423505a
add native param types ( #4137 )
...
* add native param types
* redundant phpdoc
* add more param types and adds "?" to nullable types
* remove redundant phpdoc
* add more param types and remove redundant phpdoc
* add more param types and remove redundant phpdoc
2020-09-06 19:36:47 -04:00
orklah
f66d57f19d
add native return types ( #4116 )
...
* add native return types
* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Brown
64f08fa9dc
Improve Closure::fromCallable handling
2020-08-29 22:02:58 -04:00
Brown
971ae50bea
Do prep work for #3024 - improve handling of absent class references
2020-03-26 12:35:27 -04:00
Matthew Brown
96fbcd5a64
Break out more methods
2020-03-11 23:38:49 -04:00
Matthew Brown
bfb919d26a
Break out methods into their own classes
2020-03-11 23:04:52 -04:00
Matthew Brown
1dc26afb27
Fix #2958 - prevent overriding final methods
2020-03-10 21:26:02 -04:00
Brown
d1fcbf38ae
Fix #2956 - treat Exception::getMessage as final and mutation-free
2020-03-10 15:12:55 -04:00
Matthew Brown
b999037263
Fix #2928 - properly expand out skipped template inheritance
2020-03-06 19:24:47 -05:00
Brown
35c1670602
Fix #2875 - treat intersections more similarly than before
2020-02-27 18:42:15 -05:00
Brown
0e23fab5d2
Detect bugs similar to that which caused #2832
2020-02-18 12:53:54 -05:00
Matthew Brown
653353709a
Use MethodIdentifier object instead of string
2020-02-14 20:54:26 -05:00
Brown
d5f71bf529
Localise template checks to class being tested
2020-02-06 16:38:45 -05:00
Brown
dbdf7473f4
Fix abstract trait method implementation errors when using self
2020-01-24 11:15:35 -05:00
Brown
a2e1dfd64e
Fix #2667 - don’t check inherited signature return types for accuracy
2020-01-21 11:07:44 -05:00
Matthew Brown
c50fa27025
Identify trait method access level violations as less serious
2020-01-17 00:28:08 -05:00
Matthew Brown
257ebfd205
Improve trait method mismatch failure rules
2020-01-16 22:36:30 -05:00
Matthew Brown
9fa2db1b6c
Move Union::getTypes to Union::getAtomicTypes
2020-01-04 12:20:26 -05:00
Matthew Brown
c79ba0b09e
Include non-empty-string type in more places
2019-12-30 07:25:36 -05:00
Matthew Brown
55c2f7faa2
Fix #2508 - don’t replace templated types with generic ones inside own function
2019-12-28 18:38:02 -05:00
Matthew Brown
8c1638efc5
Fix tests once more
2019-12-20 19:37:36 +00:00
Matthew Brown
e475a1826c
Issues with non-abstract methods should always be MethodSignatureMismatches
2019-12-20 18:08:35 +00:00
Matthew Brown
a5434aabfe
Fix #2491 - report trait issues at the most local place
2019-12-20 17:57:31 +00:00
Matthew Brown
49a3f89526
Fix #2478 - process trait template inheritance sensibly
2019-12-18 13:58:37 +00:00
Matthew Brown
d1c4c85f97
Support covariant return types & contravariant param types
...
Fixes #2102 and #2264
2019-11-27 00:19:36 -05:00
Brown
1f07ea7ee7
Tighten up Psalm’s inference
2019-11-25 15:20:31 -05:00
Matthew Brown
8f421dc0bb
Refactor template calculation out from Psalm\Type\Union
2019-11-03 21:27:40 -05:00
Brown
5e47cda6e5
Fix #2170 - allow @method annotations to override inherited immutable ones
2019-09-25 17:39:32 -04:00
Matthew Brown
add051c2be
Enforce immutability constraints only on interface methods
2019-09-22 09:26:26 -04:00
Matthew Brown
914ef5a5dd
Fix #2091 - $this properties should be replaced in trait types
2019-09-01 15:45:28 -04:00
Matthew Brown
c5f62d261d
Remove redundant @psalm-suppress in Psalm’s codebsae
2019-08-18 16:10:12 -04:00
Matthew Brown
1ae9ea5fed
Use object instead of by-ref params
2019-07-10 01:35:57 -04:00
LeSuisse
f29826b958
Fully qualify constants and function calls ( #1849 )
...
This should give a small performance boost.
Part of #1837 .
The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Matthew Brown
c0b86bd40d
Use uppercase template_type_extends keys
2019-06-24 23:43:04 -04:00
Matthew Brown
7fc11af49e
Fix docblocks with @andrew-demb’s suggestions
2019-06-16 09:12:32 -04:00
Matthew Brown
2fa0f27872
Prevent LessSpecificImplementedReturnType with extended template
2019-06-07 18:42:26 -04:00
Matthew Brown
0bcf61dee7
Remove more commas
2019-05-25 12:18:12 -04:00
Matthew Brown
857314e095
Remove trailing comma
2019-05-25 12:11:46 -04:00
Matthew Brown
790bc53bfd
Fix #1681 - interpret parent annotation properly
2019-05-25 11:51:09 -04:00
Barney Laurance
6fbe2b0837
Extract function NamespaceAnalyzer::nameSpaceRootsMatch
2019-05-14 18:54:16 -04:00
Barney Laurance
14843ed58a
psalm-internal - extract function NamespaceAnalyzer::isWithin
...
Also adjust behaviour so things can be internal to classes, not just to
namespace, and namespace comparision is case insensitive
2019-05-14 18:54:16 -04:00
Barney Laurance
cd673538f1
psalm-internal - refactor - use snake_case not camelCase
2019-05-14 18:54:16 -04:00
Barney Laurance
c35d21580f
psalm-return - remove unusued variable
2019-05-14 18:54:16 -04:00