1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 10:07:52 +01:00
Commit Graph

78 Commits

Author SHA1 Message Date
Matthew Brown
c38cf9b672 Migrate type reconciliation code to its own class 2017-12-29 10:55:53 -05:00
Matthew Brown
035f528581 Make sure that combining false with false simplifies to false 2017-12-19 00:06:05 -05:00
Matthew Brown
298ee214e9 Only allow variables greater than a number to be non-null 2017-12-13 20:48:01 -05:00
Matthew Brown
e63441af1e Make sure $a > 0 removes null from $a
Fixes #186
2017-12-13 20:06:19 -05:00
Matthew Brown
a345ec49a1 Fix is_bool checks on true vars 2017-12-09 16:05:31 -05:00
Matthew Brown
13f290038a Improve RedundantCondition checks and add true type
Fixes #383
2017-12-09 14:53:39 -05:00
Matt Brown
e2b1b24dbf Fix empty checks, make them more like isset checks
Fixes #372
2017-12-05 12:14:10 -05:00
Matthew Brown
7d003c5bc1 Fix erroneous treatment of or clauses in if statements 2017-12-03 16:25:52 -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
b1a35d6a6e Remove numeric types with !is_numeric check, fix #330 2017-11-21 20:58:08 -05:00
Matthew Brown
f5f7849d3a Fix erroneous merging of types 2017-11-20 20:06:00 -05:00
Matthew Brown
467bbba593 Prevent falsy values from leaking into the type system 2017-10-23 22:04:07 -04:00
Matthew Brown
a34de5b79c Fix #257 - prevent collapsing callable into string 2017-10-23 08:00:28 -04:00
Matthew Brown
e41e1fa57d Fix #256 - don’t crash when encountering types that match one another 2017-10-23 07:35:28 -04:00
Matthew Brown
2c18686c8c Fix #247 - allow is_callable checks on array 2017-10-22 21:07:06 -04:00
Matthew Brown
f9032924e6 Allow == true comparisons to be evaluated to !falsy 2017-10-22 12:09:22 -04:00
Matthew Brown
f6e01b5925 Change empty type assertions to "falsy"
As empty has a special meaning
2017-10-22 11:57:41 -04:00
Matthew Brown
8aabcbce35 Introduce UntypedParam warnings when functions are missing param types 2017-09-02 11:18:56 -04:00
Matthew Brown
4175295113 Isolate where we load static storage objects (#195)
* Move FileChecker::$storage calls to provider

* Add ClassLikeStorageProvider

* Use ClassLikeStorageProvider everywhere

* Move storage arrays into providers
2017-07-29 15:05:06 -04:00
Matt Brown
ac70ea31b2 Change test assertion keying 2017-06-29 10:22:49 -04:00
Matthew Brown
bc35f88859 Fix issue with $this instanceof checks in traits 2017-06-23 00:39:37 -04:00
Matthew Brown
22a716f4da Improve formatting of phpdocs 2017-05-26 20:16:18 -04:00
Matthew Brown
d6909193ea Add additional formatting changes 2017-05-26 20:05:57 -04:00
Matt Brown
a4bdca55e9 Fix sscanf test with new types 2017-05-05 19:56:45 -04:00
Jon Ursenbach
11bc153deb Rewriting and streamlining every unit test with data providers. (#147)
* Rewriting and streamlining every unit test with data providers.

All unit tests have been rewritten into PHPUnit data providers
to reduce the amount of unnecessary code-reuse through out the
test suite.
2017-04-24 23:45:02 -04:00
Matthew Brown
1a8cdc5da9 Allow two or more instanceof interface checks side by side 2017-04-15 21:25:53 -04:00
Matthew Brown
f67e92023b Add support for intersection types
Fixes #140
2017-04-15 20:36:40 -04:00
Matthew Brown
eebaf5795d Fix regression dealing with union types from docblocks 2017-04-15 12:44:38 -04:00
Matthew Brown
40427839ea Get all variables possibly assigned in conditional 2017-04-06 22:56:37 -04:00
Matthew Brown
20b0460a33 Fix #123 - ternary byref vars now adjusted 2017-04-06 21:53:29 -04:00
Matt Brown
c09b0e459a Make is_numeric a proper type refinement 2017-04-06 18:06:24 -04:00
Matt Brown
e7aec27eae Prevent emitting issues when comparing mixed values 2017-04-06 17:40:15 -04:00
Matt Brown
da19b55db1 Add special TypeDoesNotContainNull issue as distinct from TypeDoesNotContainType 2017-04-06 15:36:22 -04:00
Matt Brown
14bb967c7d Warn when doing === comparisons on incompatible types 2017-04-06 14:53:45 -04:00
Matthew Brown
c33e66813a Move type algebra functionality to separate checker 2017-03-18 13:37:00 -04:00
Matthew Brown
6cfe540c98 Fix issue evaluating elseif empty assertions 2017-03-14 15:48:52 -04:00
Matt Brown
b3bb8b72cc Add additional tests 2017-03-13 18:07:36 -04:00
Matthew Brown
a7da88bad3 Improve solution to allow for more user errors 2017-03-11 12:32:27 -05:00
Matthew Brown
39b9afcdac Fix issue running isset after empty array check 2017-03-11 12:05:23 -05:00
Matt Brown
c6a625c16e Fix #102 - be more lenient about whether a type can be reconciled 2017-02-21 16:15:39 -05:00
Matthew Brown
cdcacc395d Rename DeadCode to UnusedVariable, UnusedMethod and UnusedClass 2017-02-08 00:28:26 -05:00
Matthew Brown
01beb97413 Fix #87 - array types from docblocks can be reasoned about safely 2017-02-03 22:07:14 -05:00
Matthew Brown
e925e8b4db Fix #86 - remove empty array from type on !empty check 2017-02-01 13:51:26 -05:00
Matt Brown
a7872472be Add stubbing tests and modify config initialisation 2017-01-31 19:22:05 -05:00
Matthew Brown
ce93c4ef2d Assert smart things when offset is variable 2017-01-31 01:35:44 -05:00
Matthew Brown
965a79251d Fix #82 by updating how isset calls are handled 2017-01-31 00:34:06 -05:00
Matthew Brown
6bcc763414 Fix #3 by checking inside __constructor calls for initialisations 2017-01-26 23:23:12 -07:00
Matt Brown
d3a9452cde Make sure we don’t lose type information while reconciling 2017-01-19 17:45:42 -05:00
Matthew Brown
27a018095b Fix invalid InvalidParamDefault error when comparing to false 2017-01-19 01:12:19 -05:00
Matt Brown
b23c55e570 Fix #70 by allowing string to be a numeric 2017-01-18 11:07:38 -05:00