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

132 Commits

Author SHA1 Message Date
Matt Brown
6460d907f9 Improve array handling when offsets hard to define 2018-05-07 16:22:04 -04:00
Matthew Brown
61aeea6375 Fix whole bunches of things 2018-05-07 01:26:06 -04:00
Matthew Brown
7ccc17cd98 Fix #324 - improve undefined array handling 2018-05-02 20:10:08 -04:00
Matt Brown
6afaf5aae9 Make Psalm compatible with PHP Parser 4 2018-04-17 13:06:02 -04:00
Matthew Brown
0f0f405b9f Allow mixed property assignment when the user wants it
Fixes #652
2018-04-07 12:13:30 -04:00
Matt Brown
fd9e783a37 Emit InvalidDocblock for bad static keyword in @var
Ref #623
2018-03-27 11:34:48 -04:00
Matthew Brown
9404de699d Allow list vars to have array keys 2018-03-21 08:48:30 -04:00
Matthew Brown
eb3750d8f3 Remove unnecessary @var annotations 2018-03-17 00:19:55 -04:00
Matt Brown
4bf652863b Also check for non-false returns on LessSpecificReturnType 2018-03-07 11:16:56 -05:00
Matthew Brown
f17ba65731 Fix #438 - assign both sides of by-ref vars to mixed 2018-02-11 10:39:21 -05:00
Matthew Brown
6955f77e2e Fix #493 - add support for multiple @var lines per docblock 2018-02-07 23:33:31 -05:00
Matthew Brown
8e0998e081 Break apart the Codebase class 2018-02-03 18:56:54 -05:00
Matthew Brown
fb300baa6d Move a bunch of code into Codebase 2018-02-01 00:50:01 -05:00
Matt Brown
fc805a926e Add code coverage message at the end of a scan 2018-01-31 16:08:52 -05:00
Matthew Brown
44b8b22995 Improve checks for unused variables and params 2018-01-28 17:28:34 -05:00
Matt Brown
a2d11cce51 Fix static/self return type handling 2018-01-26 13:51:00 -05:00
Matthew Brown
ea28ee709d Improve unused variable detection slightly 2018-01-25 01:04:26 -05:00
Matt Brown
543872f186 Allow @psalm-ignore-falsable-return annotation
Downgrades issues around use of current(), reset(), end() etc.
2018-01-24 18:52:58 -05:00
Matt Brown
f46cf729bb Allow null checks against preg_replace and related 2018-01-24 17:07:03 -05:00
Matthew Brown
68b00ea49a Add automatic fix for PossiblyUndefinedVariable 2018-01-21 16:24:20 -05:00
Matthew Brown
bd6e4a09bd Refactor to break up too-large-files 2018-01-14 12:09:40 -05:00
Matthew Brown
e402ae978a Fix Array_ items nullability 2018-01-13 18:33:32 -05:00
Matthew Brown
f3bfb089ad Don’t investigate property mutations if they’re not visible 2018-01-13 01:52:46 -05:00
Matt Brown
72848477c2 Add all Possibly* issues to more lenient config
And add granularity to InvalidPropertyAssignment* issues
2018-01-10 10:56:43 -05:00
Matt Brown
edde8930af Speed up Psalm by caching result of Union::getId 2018-01-09 15:05:48 -05:00
Matthew Brown
de269f969b Void return types shouldn’t magically become null ones 2018-01-09 00:29:43 -05:00
Matt Brown
e6aae2f2e2 Fix issue assigning string-typed properties without a string cast 2018-01-02 18:01:59 -05:00
Matthew Brown
81cfe09fae Improve reporting of classlike locations in docblocks 2018-01-01 20:04:03 -05:00
Matthew Brown
53d887d356 Make sure nested lists get some sort of assignments 2017-12-18 23:13:18 -05:00
Matthew Brown
45fc9fd5d9 Check LHS of property when RHS is variable 2017-12-18 22:35:03 -05:00
Matthew Brown
17edb2bbe6
Add better understanding of arrays with keyed integer offsets (#400)
* Add tests for keyed integer assignemnt

* First pass to get keyed integer assignment working

* Fix array assignment to object-like with different key type

* Improve treatment of objectlikes for callable and iterable comparisons

* Fix array assignment to strings and addition

* Convert expression to CNF

* Do better at merging property types

* Fix array_rand key type
2017-12-18 18:47:17 -05:00
Matthew Brown
3b7c84f484 Detect instances where loop invariants are invalidated
Fixes #389
2017-12-17 10:58:03 -05:00
Matt Brown
062d46c132 Update to latest php-cs-fixer 2017-11-30 19:00:09 -05:00
Matthew Brown
f27bd50abe
Add RedundantCondition issue, replacing FailedTypeResolution (#344)
* Group changes

* Don’t worry about vars defined before exiting

* Fix issues with vars defined in conditionals

* Add failing test

* Only add failed reconciliation flag if nothing could be salvaged

* Avoid notice when removing clauses

* Improve handling of loops

* Fix evaluation of binary op expressions

* Remove unset vars from outer context after loop

* Ignore RedundantCondition in some more configs
2017-11-28 00:46:41 -05:00
Matthew Brown
18cf05e087 Always keep track of assigned var ids 2017-11-25 11:21:45 -05:00
Matthew Brown
4312ef380b Fix issues found by improved Psalm checks
cc @TysonAndre, found with RedundantCondition checks
2017-11-24 12:10:30 -05:00
Matt Brown
a069cf4ea9 Don‘t turn a string into an array|string by accident 2017-11-20 17:10:05 -05:00
Matt Brown
0c2ea418e3 Fix #327 - prevent null array value from killing assignment 2017-11-20 16:19:40 -05:00
Matt Brown
f46fd0b79f Fix array access on objects 2017-11-20 11:49:26 -05:00
Matthew Brown
5698b2d363 Update root var with more accurate object-like type 2017-11-19 22:28:52 -05:00
Matthew Brown
8b2df09f0f Fix issue with object-like reassignment 2017-11-19 21:24:29 -05:00
Matthew Brown
8d62fc8ad1 Only update array type if it doesn’t have an object 2017-11-19 14:38:00 -05:00
Matthew Brown
5ff4badf33
Refactor array analysis to improve reliability and accuracy (#325) 2017-11-19 12:33:43 -05:00
Matt Brown
2a96e323e7 Fix assignment to arrays after object-like 2017-11-17 12:27:16 -05:00
Matthew Brown
a08306973a Fix #302 - add a way to seal objects with magic properties 2017-11-16 20:47:58 -05:00
Matthew Brown
abe7c003ab Fix #309 - borrowing fix from @TysonAndre 2017-11-15 20:45:53 -05:00
Matt Brown
9111b1c725 Fix #301 - add PossiblyInvalidPropertyAssignment 2017-11-15 11:15:03 -05:00
Matthew Brown
b2ae9a2892 Fix #291, #292 and #297 by improving docblock parsing 2017-11-14 21:43:31 -05:00
Matthew Brown
765d82548d Remove more dead code 2017-11-08 23:27:51 -05:00
Tyson Andre
b3505cfbef Get rid of unused variables in psalm's codebase (#272)
* Remove unused variables

* Fix more unused variables

* Fix remaining detected undefined variables

Other 20 detected undefined variable warnings were false positives.
2017-11-08 23:14:27 -05:00