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

139 Commits

Author SHA1 Message Date
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
5e0a8c4339 Inherit correct self return type 2018-01-26 10:59:30 -05:00
Matt Brown
1a2d13ae32 Ignore falsable issues from core functions 2018-01-25 13:07:36 -05:00
Matthew Brown
ea28ee709d Improve unused variable detection slightly 2018-01-25 01:04:26 -05:00
Matt Brown
f46cf729bb Allow null checks against preg_replace and related 2018-01-24 17:07:03 -05:00
Matthew Brown
bc9761f6c9 Create Codebase out from ProjectChecker 2018-01-21 13:45:33 -05:00
Matthew Brown
92e43b8fa0 Add a few optimisations 2018-01-20 21:22:33 -05:00
Matt Brown
a253ca68bc Allow array_filter to inspect closure bodies 2018-01-17 16:07:46 -05:00
Matt Brown
edde8930af Speed up Psalm by caching result of Union::getId 2018-01-09 15:05:48 -05:00
Matthew Brown
8ababf1537 Allow assertions on mixed vars 2018-01-08 00:14:02 -05:00
Matthew Brown
8e4f8fabe3 Fix getenv calls
Fixes #386
2018-01-08 00:09:22 -05:00
Matthew Brown
6e7bab58c4 Be better about inherited core method arg types 2018-01-04 18:58:03 -05:00
Matthew Brown
5afe3b10fa Scan compoer autoload files before any sweep of code 2018-01-01 11:47:03 -05:00
Matthew Brown
290cf396d4 Remove unnecessary suppression 2017-12-31 13:12:19 -05:00
Matthew Brown
f81642c1eb Fix location of function param vars 2017-12-29 21:28:21 -05:00
Matthew Brown
e2e1094ec6 Fix #407 - improve treatment of array_merge unpacked args 2017-12-23 02:09:58 +01: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
Matt Brown
3b4a7a97bc Don’t treat callmap scalar types as any sort of filtering mechanism
Fixes #393 and fixes #394
2017-12-15 16:48:06 -05:00
Matthew Brown
cb9079ca88 Improve generic param replacement 2017-12-03 11:23:40 -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
abe7c003ab Fix #309 - borrowing fix from @TysonAndre 2017-11-15 20:45:53 -05:00
Matthew Brown
2f1e3652b7 Fix #274 - improve array addition inference for objectlike arrays 2017-11-11 14:19:57 -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
Matthew Brown
a7b32beb4e Add better checks for array_rand’s signature 2017-11-08 21:56:54 -05:00
Matt Brown
c395930a06 Fix missing function issue ref #251 2017-10-19 18:23:18 -04:00
Matthew Brown
a0c27cee4f Allow param types to be inferred from presence of concat ops 2017-09-02 19:23:00 -04:00
Matthew Brown
622217b708 Fix #205 - add file references at analysis stage too 2017-08-22 12:38:38 -04:00
Matt Brown
3075f16308 Ignore static, self and parent in callable class names 2017-08-18 17:02:15 -04:00
Matt Brown
c626b7d68a Fix #200 - allow mapping of more callable strings, and callable arrays 2017-08-14 19:30: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
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
cfbf256593 Add version check for reflected function return type 2017-07-10 10:38:02 -04:00
Matthew Brown
dcb6ecd3fd Fix reference errors 2017-07-09 23:26:16 -04:00
Matthew Brown
05674ef3bc Fix #182 by properly registering autoload file functions 2017-07-09 23:24:06 -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
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
7532e32b9d Fixed spacing and use statement formatting 2017-05-19 00:48:26 -04:00
Matt Brown
77da5ca99e Fix #156 - allow objectlike arrays to be merged nicely 2017-05-05 18:53:45 -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
Matt Brown
d06a199d25 Fix #121 - simplify all parameter types 2017-03-30 11:44:38 -04:00
Matt Brown
864d242f13 Improve labelling of referencing expressions 2017-03-01 11:56:36 -05:00
Matthew Brown
cd5f727d2e Collect explicit references to classes/methods 2017-02-26 23:09:18 -05:00
Matt Brown
83a978ea80 Fix array_filter on string-keyed arrays 2017-02-13 19:16:25 -05:00
Matt Brown
32d85e20da Remove unused vars 2017-02-10 19:10:13 -05:00
Matt Brown
c0a6fc9125 Fix #90 - add genericised stubs for common array functions 2017-02-10 18:12:59 -05:00
Matthew Brown
98b0ed280c Add support for templating 2017-02-09 20:35:17 -05:00
Matthew Brown
95ebf5178a Add array_slice call to methods whose return types we can infer 2017-01-30 22:26:31 -05:00