1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

113 Commits

Author SHA1 Message Date
Matt Brown
eb10b15cfc Improve reliability of elseif resolution 2018-05-30 18:56:44 -04:00
Matthew Brown
09eb316a9c Fix #755 - add support for inferring explicit true checks 2018-05-19 00:41:07 -04:00
Matthew Brown
b0733254bb
Use individual type objects for each string (#757)
* Experiment with individual types for each string

* Fix bunch of errors

* Fix a few more issues

* Fix a whole bunch of bugs

* Fix most remaining bugs

* Fix isset warnings

* Fix psalm errors in psalm

* Limit big string size

* Fix falsiness of ints

* Fix issue with type widening, allowing value set in nested if to be altered

* Don’t complain if type is mixed

* Add skipped-for-now test

* Add specific test to address issue
2018-05-18 11:02:50 -04:00
Matt Brown
3263b64301 Filter conditions better when encountering parent instanceof 2018-05-16 11:47:39 -04:00
Matt Brown
02d65b617b Allow weak comparison between floats and ints 2018-05-14 12:02:06 -04:00
Matt Brown
58c68c355e Allow weak equality between scalar types 2018-05-14 10:36:41 -04:00
Matthew Brown
d46997b196 Make sure weak equality clauses don’t generate ParadoxicalCondition 2018-05-13 01:27:45 -04:00
Matthew Brown
9f28be415a Fix reconciliation of ored types 2018-05-13 00:54:12 -04:00
Matthew Brown
8e90334428 Allow assignment to numeric string via assertion 2018-05-12 19:56:17 -04:00
Matthew Brown
61aeea6375 Fix whole bunches of things 2018-05-07 01:26:06 -04:00
Matt Brown
a0984cdaf1 Fix #697 - make missing objectlike fields an InvalidArgument 2018-04-27 17:10:57 -04:00
Matthew Brown
f15c26d7f4 Change how type impossibilities are treated to improve message types 2018-04-10 01:27:26 -04:00
Matt Brown
0b268eb602 Allow scalars to be empty 2018-04-05 12:11:58 -04:00
Matt Brown
1282f74931 Allow coercion from generic array to objectlike with possible keys 2018-04-04 18:01:53 -04:00
Matthew Brown
03b3a764e3 Fix #641 - allow is_a to operate on strings as well 2018-04-03 23:14:23 -04:00
Matthew Brown
4552e69ef2 Allow classes to be instantiated by their name only
Ref #641
2018-04-03 22:20:00 -04:00
Matthew Brown
5ff6f27178 Fix #615 - numeric-string is always still a string 2018-03-22 21:48:26 -04:00
Matt Brown
cc3aafe4c4 Improve intersection type parsing 2018-03-22 17:55:36 -04:00
Matthew Brown
837f5d7096 Fix #594 - support intersection types (and catch errors) 2018-03-20 20:56:33 -04:00
Matt Brown
24490aac0e Fix #609 - fix callable coercion in reconciliation step 2018-03-20 13:24:16 -04:00
Matthew Brown
b8a8e9bc5b Add two skipped (bug-identifying) tests 2018-03-20 09:30:37 -04:00
Matthew Brown
217233472c Fix #457 - fix objectlike property isset check 2018-02-10 23:30:40 -05:00
Matt Brown
7f4be858c2 Fix #498 - add better issue type for docblock contradiction 2018-02-07 15:20:47 -05:00
Matt Brown
1df4c3d196 Add DocblockTypeContradiction to find possible issues with docblock types
Fixes #491
2018-02-06 18:44:53 -05:00
Matt Brown
1d46124bab Fix issues found by detecting docblock type inconsistencies 2018-02-06 13:40:28 -05:00
Matt Brown
4b87612bb4 Add better issue message for bad array offset
Fixes #492
2018-02-06 11:27:01 -05:00
Matt Brown
5d25edf80c Deal with overlapping docblock types and typehints better 2018-02-05 16:57:33 -05:00
Matthew Brown
fb300baa6d Move a bunch of code into Codebase 2018-02-01 00:50:01 -05:00
Matt Brown
b2b2572e4d Fix #478 - allow is_a checks with string arg 2018-01-30 16:45:29 -05:00
Matt Brown
dea5d92e9b Add support for static::class 2018-01-23 15:46:14 -05:00
Matt Brown
c0fda0ef1e Allow instanceof static checks 2018-01-23 14:46:46 -05:00
Matthew Brown
e05a7c00cc Break FileScanner out from FileChecker 2018-01-21 12:44:46 -05:00
Matt Brown
4b4e09277c Fix #450 - add checks for duplicate array keys
And fix the embarassing errors in tests
2018-01-18 17:16:50 -05:00
Matt Brown
2120d258a4 Fix formatting of return type adder 2018-01-11 15:50:58 -05:00
Matt Brown
edde8930af Speed up Psalm by caching result of Union::getId 2018-01-09 15:05:48 -05:00
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