1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 02:47:02 +01:00
Commit Graph

71 Commits

Author SHA1 Message Date
Matthew Brown
72ecb57def Improve names of things 2020-08-14 00:27:33 -04:00
Matthew Brown
6085e42fc1 Detect mismatching param names effectively 2020-08-10 09:58:43 -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
c29b3744ec Change storage of out types 2020-06-24 11:51:31 -04:00
Brown
e8be2c500e Support taint flows in more functions 2020-06-22 17:53:03 -04:00
Brown
dc83c2e2fc Add annotation for taint sources 2020-06-21 00:58:56 -04:00
Matthew Brown
081a284759 Fix #3567 - remember which variables a callable sets byref in use 2020-06-14 11:58:50 -04:00
Matthew Brown
187b944680 Add faster taint analysis 2020-05-22 12:33:29 -04:00
Matthew Brown
93735712f0 Fix #3032 - always replay docblock issues when analysing files 2020-03-28 19:54:55 -04:00
Brown
7482b9e56f Emit all stubs discovered by Psalm during analysis
Fixes #827
2020-01-08 17:23:40 -05:00
Brown
1f07ea7ee7 Tighten up Psalm’s inference 2019-11-25 15:20:31 -05:00
Brown
b29227aaf6 Allow taints to be removed via annotation 2019-10-15 16:25:27 -04:00
Brown
b7b4baff8f Add support for @immutable
Fixes #1272
2019-08-30 12:36:35 -04:00
Brown
2b2988b072 Fix #2019 - allow union in @throws 2019-08-13 15:44:18 -04:00
Matthew Brown
3df248eea2 Add concept of purity to functions and methods 2019-07-18 01:31:48 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Matthew Brown
df3d7e1d2c Make line endings mostly all the same 2019-07-03 16:58:27 -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
31c8a2e4d7 Add offsets to type tokenisation
Ref #1832
2019-06-22 23:30:40 -04:00
Ilija Tovilo
78588ced16 Only add newlines to function signature on hover (#1834)
Most editors do not render the newlines for autocompletions which makes
things look worse.
2019-06-22 15:59:16 -04:00
Ilija Tovilo
caca3e52c9 Display function signature on multiple lines when it has parameters (#1833) 2019-06-22 13:07:56 -04:00
Brown
a060da95bf Allow MissingParamType alteration to be done in multithreaded mode 2019-05-31 11:55:24 -04:00
Matthew Brown
cd969c51e5 Generate missing param types from callers
Fixes #1707
2019-05-31 01:47:35 -04:00
Barney Laurance
cd673538f1 psalm-internal - refactor - use snake_case not camelCase 2019-05-14 18:54:16 -04:00
Barney Laurance
b29e041d3c psalm-internal - prevent call to method marked psalm-internal from other namespace 2019-05-14 18:54:16 -04:00
Brown
751253ddf0 Fix #1603 - prevent invalid covariant template classes from being passed 2019-05-06 16:38:08 -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
Brown
b9ba24929d Refactor storage of template names to prevent clashes 2019-03-22 15:59:10 -04:00
Brown
601f303de2 Fix position of invalid param 2019-02-27 16:00:44 -05: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
Matthew Brown
ee2b06ac43 Add initial support for @param-out 2019-01-19 13:32:43 -05:00
Brown
b8d822cd26 Prohibit leaking of template params across class boundaries 2019-01-10 12:13:49 -05:00
Matthew Brown
9d8c2792e2 Add array-key type and improve general type handling
Fixes #1144
2019-01-05 00:15:53 -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
f017599b3f Fix how InvalidDocblock is treated
Fixes #1051 (hopefully)
2018-11-01 17:03:08 -04:00
Brown
54fdda651b Add server mode support with error reporting only 2018-10-17 15:54:31 -04:00
Matthew Brown
36bb8ae213 Fix #996 - improve handling of return type comments 2018-09-13 23:39:24 -04:00
Matthew Brown
e836f69ca2 Fix #502 - check for bad generator return in more places 2018-07-15 17:47:58 -04:00
Matthew Brown
e3ae1bf26f Fix #15 - check for uncaught throws if config flag is set 2018-06-22 01:13:49 -04:00
Matt Brown
11240eb193 Fix #826 allow better template replacements 2018-06-19 13:19:41 -04:00
Matthew Brown
dfc32216b3 Fix #800 - treat array access offsets as mixed for reconciliation purposes 2018-06-08 09:31:21 -04:00
Matthew Brown
6b8e019a07 Bleed global variables declared in functions into main context 2018-05-30 22:09:46 -04:00
Matt Brown
14f3f7a998 Fix #763 - always force rescanning of files if issues were found first time around 2018-05-29 10:13:26 -04:00
Matthew Brown
d98261507f Fix #769 - add @psalm-assert and @psalm-assert-if-true annotation support 2018-05-28 20:07:42 +01:00
Matt Brown
5c0f4a999c Move a bunch of classes to better places 2018-05-11 18:35:02 -04:00
Matt Brown
ef35cfc6fe Fix #566 - check for abstract methods inheriting from non-abstract ones 2018-03-13 12:52:00 -04:00