Brown
3687d34a5a
Detect bad class constants more explicitly
2020-07-24 15:38:56 -04:00
Barney Laurance
ff432ff73d
Simplify error messages and implementation for internal errors ( #3881 )
...
* Use more consistent language for Internal errors
There's no meaningful distinction between something being internal and
being 'marked as internal'.
* Rename property psalm_internal to internal in all storage classes
This property holds metadata that can be set using either @internal
or @psalm-internal in docblocks
* Change types of internal properties in storage from ?string to string
Simpler type is easier to handle. Non-internal methods can be considered
to be internal to the entire universe of PHP code, i.e. that code whose
namespace starts with the empty string. It's not a special case.
2020-07-24 09:32:54 -04:00
Barney Laurance
3bc91b9944
Fix multiple issues with @internal and @psalm-internal ( #3841 )
...
* Add passing tests for property fetch on an @internal class
I'm trying to work out why the equivilent InvalidCodeParse test is
failing for PsalmInternal
* Treat all properties of a psalm-internal class as psalm-internal
* Remove all $internal properties from storage - use psalm_internal instead
@internal can be represented as internal to the namespace root, avoiding
the need to check for both properties in storage later.
* Raise InternalClass issue when an internal class is used with e.g. instanceOf
* fix docs and tests
* Add return type declartion to code example in doc
* Don't allow class psalm-internal to overide a tighter method psalm-internal
* Break up long line
* Code style - move && from EOL to SOL
* Restore misplaced &&
* Fix code style
* Fix namespace fetching so it works
Co-authored-by: Matthew Brown <github@muglug.com>
2020-07-22 19:27:35 -04:00
Brown
76bd5b6278
Refactor type comparison
2020-07-21 19:40:35 -04:00
Brown
295adb5763
Fix #3860 - use correct trait element positions for nested error
2020-07-21 14:17:07 -04:00
Brown
2afbf58324
Prevent adding trait property types
2020-07-10 19:11:06 -04:00
Brown
33a834bb0b
Fix some property inference bugs
2020-07-08 14:43:36 -04:00
Brown
619c384509
Add indentation as necessary between property docblocks
2020-07-08 14:32:16 -04:00
Brown
cf67b9eef1
Fix #435 - add psalter fix for MissingPropertyType
2020-07-08 12:03:12 -04:00
Brown
6bdff42cda
Add support for potentially-assigned properties
2020-07-08 11:46:55 -04:00
Brown
0034f2e4bd
Don’t manipulate property storage during analysis
2020-07-07 19:32:44 -04:00
Brown
5da29955ee
Use better replacement when analysing potentially-inherited templated type
2020-07-03 12:25:33 -04:00
Brown
fca350c498
Prevent a few crashes with really bad code
2020-07-01 10:30:10 -04:00
Brown
bcd7478352
Reduce memory footprint a little
2020-06-25 19:12:30 -04:00
Andrei Petre
3497ca07b6
Extending final class is prohibited #3037 ( #3576 )
2020-06-13 00:29:59 -04:00
Brown
d04e21ee5a
Define mixin declaring classname
2020-05-26 23:32:07 -04:00
Brown
240b2f898c
Add some negative test cases for @mixin
...
Also fix #3452
2020-05-25 00:19:52 -04:00
Brown
0b2da18f1e
Break up StatementsAnalyzer
2020-05-19 12:56:30 -04:00
Matthew Brown
8c236f411a
Fix #3353 - allow extending nested when nested as type is mixed
2020-05-12 15:07:16 -04:00
Brown
8f2f2617d4
Improve refactor
2020-05-10 22:45:01 -04:00
Brown
5f4d162dd5
Break out type expander into separate class
2020-05-10 22:39:18 -04:00
Matthew Brown
1b752d06ab
Fix #3201 - add additional constraints on constructor initialisation
2020-04-21 00:04:47 -04:00
Brown
5ef82b53f6
Fix #3137 - support nested templates in class definitions
2020-04-17 01:16:15 -04:00
Matthew Brown
6f28ee684a
Fix #3156 - only override existing property types with @property suggestions
2020-04-16 00:22:00 -04:00
Matthew Brown
82197f1761
Add many slashes
2020-03-29 15:56:45 -04:00
Matthew Brown
ce3532490c
Add profiling for analysing slow methods
2020-03-29 15:42:00 -04:00
Matthew Brown
5395183837
Use more accurate means of determining whether function did return
2020-03-28 23:37:42 -04:00
Matthew Brown
93735712f0
Fix #3032 - always replay docblock issues when analysing files
2020-03-28 19:54:55 -04:00
Matthew Brown
47c1470e3b
Refactor reference checks to use more appropriate properties
2020-03-28 16:30:56 -04:00
Brown
cc548a45fa
Improve detection of unused classes
2020-03-28 14:45:58 -04:00
Brown
056f4aaac6
Fix #3027 - inherited properties should be templated properly
2020-03-27 18:31:48 -04:00
Brown
031c5be8e6
Check trait methods better
2020-03-27 00:37:33 -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
f94ab22a5f
Be better about strict inference
2020-03-25 09:18:49 -04:00
Matthew Brown
26694345d6
Fix unknown variable
2020-03-21 20:53:46 -04:00
Matthew Brown
6746f1c047
Fix #3004 - reset property types inside a closure defined in a class
2020-03-21 20:46:38 -04:00
Matthew Brown
96fbcd5a64
Break out more methods
2020-03-11 23:38:49 -04:00
Matthew Brown
973703e396
Break out template param collection
2020-03-11 23:15:15 -04:00
Matthew Brown
bfb919d26a
Break out methods into their own classes
2020-03-11 23:04:52 -04:00
Brown
2c8688dd97
Don’t crash when conditionally defining classes with properties
2020-03-09 14:24:19 -04:00
Matthew Brown
c0c878cc9d
Don’t cache all traits
2020-03-02 22:27:54 -05:00
Matthew Brown
e0d555e203
Allow function names to passed in as strings for callable template resolution
2020-02-29 15:43:45 -05:00
Matthew Brown
a706f4d722
Fix #2242 - warn when using mutable dependencies
2020-02-22 10:04:46 -05:00
Matthew Brown
653353709a
Use MethodIdentifier object instead of string
2020-02-14 20:54:26 -05:00
Matthew Brown
07a53f6b81
Fix #2789 - Numeric should not be a reserved class name
2020-02-11 22:34:34 -05:00
Brown
f141f7c526
Improve --diff checks by including trait-using classes in dependents
2020-02-11 16:39:33 -05:00
Brown
d8f5ad190b
Improve invalidation of inherited properties
2020-02-10 17:03:51 -05:00
Matthew Brown
da541dbb51
Remove some unnecessary errors
2020-02-06 23:10:18 -05:00
Brown
6116b457ed
Port over more fixes from template match refactor
2020-02-06 15:07:57 -05:00
Brown
4c83ca75b3
Fix #2738 - clear out property issues when modifying constructors
2020-02-03 16:43:25 -05:00