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

115 Commits

Author SHA1 Message Date
Matthew Brown
6e7bab58c4 Be better about inherited core method arg types 2018-01-04 18:58:03 -05:00
Matthew Brown
81cfe09fae Improve reporting of classlike locations in docblocks 2018-01-01 20:04:03 -05:00
Matthew Brown
1608463b09 Strip leading slashes from generic object classes on creation 2017-12-31 21:17:39 -05:00
Matthew Brown
875bb8c072 Improve dead code detection, reducing false positives for params 2017-12-29 17:27:16 -05:00
Matthew Brown
8efc939a5f Move Psalm execution code into PHP file that Psalm can analyse 2017-12-29 17:02:56 -05:00
Matthew Brown
0b58ee425d Fix trait method evaluation order 2017-12-29 11:26:28 -05:00
Matthew Brown
c38cf9b672 Migrate type reconciliation code to its own class 2017-12-29 10:55:53 -05:00
Matthew Brown
0e6006deda Fix #328 and allow single-entry object-like shorthand 2017-12-18 22:07:52 -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
2011b8fb8f Remove dead code 2017-12-16 10:51:04 -05:00
Matthew Brown
42dcd136ca Improve treatment of true and fix #369 2017-12-09 15:51:38 -05:00
Matthew Brown
13f290038a Improve RedundantCondition checks and add true type
Fixes #383
2017-12-09 14:53:39 -05:00
Matt Brown
eca7351472 Add return-level issues as well as function-level ones
Fixes #379
2017-12-07 15:50:25 -05:00
Matthew Brown
52fc81e4ab Remove need for a __toString return type
Fixes #364
2017-12-05 23:47:50 -05:00
Matthew Brown
6843dfb7fc Remove from_docblock status if we make a successful method call 2017-12-03 17:21:20 -05:00
Matthew Brown
cb4691fb44 Always set templated types as being from docblocks 2017-12-03 13:22:06 -05:00
Matthew Brown
cff7f35d00 Change __toString type conversions to more precise getId checks 2017-12-03 12:44:08 -05:00
Matthew Brown
cb9079ca88 Improve generic param replacement 2017-12-03 11:23:40 -05:00
Tyson Andre
f8f67d4d86 grammar nit for TypeParseTreeException (#359)
Noticed when looking at recent changes
2017-12-03 01:06:14 -05:00
Matthew Brown
495252494f Fix buggy switch statement revealed after switch fixes 2017-11-28 22:46:43 -05:00
Matt Brown
b8b1169a03 Consolidate intersection type checks in one place 2017-11-27 18:07:38 -05:00
Matthew Brown
f5f7849d3a Fix erroneous merging of types 2017-11-20 20:06:00 -05:00
Matt Brown
9081da21a6 Prevent false->bool resolution mismatch 2017-11-20 11:18:01 -05:00
Matthew Brown
ae799da8d0 Add root array var when updating array key type in if 2017-11-19 23:25:14 -05:00
Matthew Brown
75b6e21801 Fix #315 - improve checking of object-like arrays in function params 2017-11-19 13:05:35 -05:00
Matt Brown
c850ef644d Add PossiblyFalseReference and PossiblyFalseArgument issues
Useful for catching error cases
2017-10-23 11:47:00 -04:00
Matthew Brown
d455e24958 Make shallow type comparison case insensitive ref #240 2017-10-12 19:46:00 -04:00
Matthew Brown
1cc13bdeeb Prevent TNamedObject from having a leading slash 2017-10-06 23:35:16 -04:00
Matt Brown
d1807cfb95 Improve checks for switch types 2017-09-11 11:58:11 -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
aca295ef7d Build up file-class references on initial scan 2017-07-27 16:13:26 -04:00
Matthew Brown
e29dd140e3 Refactor scanning and analysis, introducing multithreading (#191)
* Add failing test

* Add visitor to soup up classlike references

* Move a whole bunch of code into the visitor

* Move some methods back, move onto analysis stage

* Use the getAliases method everywhere

* Fix refs

* Fix more refs

* Fix some tests

* Fix more tests

* Fix include tests

* Shift config class finding to project checker and fix bugs

* Fix a few more tests

* transition test to new syntax

* Remove var_dump

* Delete a bunch of code and fix mutation test

* Remove unnecessary visitation

* Transition to better mocked out file provider, breaking some cached statement loading

* Use different scheme for naming anonymous classes

* Fix anonymous class issues

* Refactor file/statement loading

* Add specific property types

* Fix mapped property assignment

* Improve how we deal with traits

* Fix trait checking

* Pass Psalm checks

* Add multi-process support

* Delay console output until the end

* Remove PHP 7 syntax

* Update file storage with classes

* Fix scanning individual files and add reflection return types

* Always turn XDebug off

* Add quicker method of getting method mutations

* Queue return types for crawling

* Interpret all strings as possible classes once we see a `get_class` call

* Check invalid return types again

* Fix template namespacing issues

* Default to class-insensitive file names for includes

* Don’t overwrite existing issues data

* Add var docblocks for scanning

* Add null check

* Fix loading of external classes in templates

* Only try to populate class when we haven’t yet seen it’s not a class

* Fix trait property accessibility

* Only ever improve docblock param type

* Make param replacement more robust

* Fix static const missing inferred type

* Fix a few more tests

* Register constant definitions

* Fix trait aliasing

* Skip constant type tests for now

* Fix linting issues

* Make sure caching is off for tests

* Remove unnecessary return

* Use emulative parser if on PHP 5.6

* Cache parser for faster first-time parse

* Fix constant resolution when scanning classes

* Remove test that’s beyond a practical scope

* Add back --diff support

* Add --help for --threads

* Remove unused vars
2017-07-25 16:11:02 -04:00
Matt Brown
3dceebc42f Make type combination less dependant on __toString 2017-06-29 17:40:25 -04:00
Matt Brown
effdec6b1d Separate objectlike types into their own container 2017-06-29 11:48:00 -04:00
Matt Brown
3775b29e30 Move by-ref types into object 2017-06-29 11:18:02 -04:00
Matthew Brown
22a716f4da Improve formatting of phpdocs 2017-05-26 20:16:18 -04:00
Matthew Brown
4fd46e1752 Improve formatting 2017-05-24 22:07:49 -04:00
muglug
77a44051c5 Fix issues with @psalm-ignore-nullable-return types 2017-05-22 14:50:03 -04:00
Matthew Brown
92e184086f Fix #158 - prevent using resource in return type 2017-05-21 13:48:17 -04:00
Matthew Brown
7532e32b9d Fixed spacing and use statement formatting 2017-05-19 00:48:26 -04:00
github@muglug.com
9ff8736e53 Add the means to ignore PossiblyNull* errors from the type itself 2017-05-09 16:38:58 -04:00
Jon Ursenbach
f65c618b2e PSR-2 adjustments and adding PHPCS checks into the Travis config. (#149)
* PSR-2 adjustments and adding PHPCS checks into the Travis config.

* Reverting some CallChecker changes and no longer casting vars to null.
2017-04-28 00:31:55 -04:00
Matthew Brown
f67e92023b Add support for intersection types
Fixes #140
2017-04-15 20:36:40 -04:00
Matthew Brown
73b5eb1530 Uncomplicate __toString method 2017-03-20 01:36:51 -04:00
Matthew Brown
5c7df08862 Add optimisations speed up heavily-used methods 2017-03-19 23:26:45 -04:00
Matt Brown
3d2be3410e Infer loop types without @var comments 2017-03-13 18:06:56 -04:00
Matthew Brown
a7da88bad3 Improve solution to allow for more user errors 2017-03-11 12:32:27 -05:00
Matt Brown
f9f38f283e Emit issue when property type is not defined 2017-03-02 12:19:18 -05:00
Matt Brown
864d242f13 Improve labelling of referencing expressions 2017-03-01 11:56:36 -05:00
Matt Brown
32d85e20da Remove unused vars 2017-02-10 19:10:13 -05:00