1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-16 11:26:55 +01:00
Commit Graph

28 Commits

Author SHA1 Message Date
Matt Brown
f8eee22f77 Add basic support for PHP attributes
Ref #4367 - supports creation and argument checks
2020-10-24 00:10:22 -04:00
Matt Brown
fb604bfacb 4.x - move class constants into their own storage object 2020-10-05 09:50:32 -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
262bb9fd89 Invalidate memoized getter method results after property assignment 2020-07-16 12:59:49 -04:00
Matthew Brown
93fc1b1cc7 Fix #2729 - allow mutation of otherwise-readonly properties 2020-02-02 15:35:12 -05:00
Brown
1f07ea7ee7 Tighten up Psalm’s inference 2019-11-25 15:20:31 -05:00
Matthew Brown
7ed30cd5b0 Add support for @readonly annotation 2019-08-11 16:01:37 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Brown
aa6677a177 Add autocompletion for some classes
Ref #1822
2019-06-21 17:10:35 -04:00
Barney Laurance
cd673538f1 psalm-internal - refactor - use snake_case not camelCase 2019-05-14 18:54:16 -04:00
Barney Laurance
ce5d307f83 psalm-internal - present fetching internal property from other namespace 2019-05-14 18:54:16 -04:00
Brown
80e28d6a4a Add support for unused method & property automated removal 2019-04-17 11:12:18 -04:00
Brown
26e2de93c7 Prepare to enable paralellised use of --find-dead-code
References #1548
2019-04-12 18:28:07 -04:00
Bruce Weirdan
abb1c95b94 Limited custom metadata to be (array of) scalars
Also moved `$custom_metadata` property to trait
2019-02-25 10:19:31 -05:00
Bruce Weirdan
19a9ff4bcf Added custom storage metadata 2019-02-25 10:19:31 -05:00
Brown
1fddc19172 Add initial support for property types 2019-01-11 17:21:50 -05:00
Matthew Brown
b32000fa05 Fix #689 - add checks for @internal annotations 2018-12-01 18:37:49 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Brown
e286089eaa Add onchange events and symbol lookup with disabled completion 2018-10-26 16:17:15 -04:00
Brown
54fdda651b Add server mode support with error reporting only 2018-10-17 15:54:31 -04:00
Matthew Brown
fb9f20f4b8 Find unused properties with dead code checks
Fixes #424
2018-01-10 23:29:18 -05:00
Matthew Brown
688a72c794 Fix #36 - emit issues on deprecated properties 2017-05-25 01:32:34 -04:00
Matthew Brown
60be6f07a0 Delay checks for MissingPropertyType so we can give more useful messages 2017-04-14 23:09:34 -04:00
Matthew Brown
5cd1b6735f Add even more references in docblocks 2017-03-01 22:27:52 -05:00
Matthew Brown
98d4ced24f Make location of not-set-in-constructor errors more precise 2017-01-26 23:40:22 -07:00
Matthew Brown
6bcc763414 Fix #3 by checking inside __constructor calls for initialisations 2017-01-26 23:23:12 -07:00
Matthew Brown
883ca6a5db Fix #30 by consolidating properties into single storage array 2017-01-01 19:09:17 -05:00