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

196 Commits

Author SHA1 Message Date
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
Matthew Brown
c7b0f6685f Make Psalm a bit faster 2017-07-08 21:19:16 -04:00
Matthew Brown
91bdd65588 Fix #179 - check for abstract method instantiations 2017-06-30 10:24:47 -04:00
Matt Brown
5220df4837 Fix #177 - treat return type as nullable due to try 2017-06-29 10:33:54 -04:00
Matt Brown
f49d167a49 Add tracking from where a trait was included 2017-06-21 14:22:52 -04:00
Matt Brown
f4338c38e7 Fix #148 - suppress InvalidDocblock where appropriate 2017-06-13 14:00:41 -04:00
Matthew Brown
81223c45e0 Fix #166 - return instead of looping infinitely 2017-06-05 21:46:04 +01:00
Matthew Brown
8c0aced195 Add specific check for return type parse issue ref #165 2017-05-29 20:58:49 -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
Matthew Brown
96e3ad02fc Remove blank line 2017-05-21 13:52:06 -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
Matt Brown
052624fa94 Fix issue calculating inherited parent property mutations 2017-05-12 19:15:08 -04:00
Matt Brown
53b81ac2e1 Fix pass-by-ref 2017-05-10 14:05:26 -04:00
github@muglug.com
20d4831f67 Improve return type ignore_nullable inference 2017-05-10 14:03:51 -04:00
Matt Brown
d7e2c5ee3c Don’t emit InvalidReturnType when we don’t care about nullability 2017-05-10 13:52:24 -04:00
Matt Brown
39ece995b6 Add @psalm-ignore-nullable-return annotation 2017-05-10 12:36:11 -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
8d46c65815 Only make non-null if inside constructor 2017-04-14 23:26:58 -04:00
Matt Brown
ed356bfbd0 Don’t mistake same-named functions for old-style constructors
Fixes #131
2017-04-10 11:03:19 -04:00
Matt Brown
5b34163d8d Add ability to insert suppressed issues on functions 2017-03-31 11:21:34 -04:00
Matt Brown
d06a199d25 Fix #121 - simplify all parameter types 2017-03-30 11:44:38 -04:00
Matthew Brown
caf72bda52 Shave off a little extra time by caching file_checker refs 2017-03-19 23:30:20 -04:00
Matthew Brown
fc4a72d905 Store reflected variadic function parameters 2017-03-19 18:31:19 -04:00
Matthew Brown
e687887ba3 Emit an InvalidReturnType when it should contain null, and introduct LessSpecificReturnType 2017-03-18 12:18:17 -04:00
Matthew Brown
9b41bc9b37 Add slower (but more accurate) loop checks 2017-03-14 20:14:25 -04:00
Matt Brown
f9f38f283e Emit issue when property type is not defined 2017-03-02 12:19:18 -05:00
Matthew Brown
5cd1b6735f Add even more references in docblocks 2017-03-01 22:27:52 -05:00
Matt Brown
6d1f557ca4 Add docblock type location 2017-03-01 18:36:04 -05:00
Matt Brown
864d242f13 Improve labelling of referencing expressions 2017-03-01 11:56:36 -05:00
Matthew Brown
d9433c9491 Add way to find all references to a given class or method in the codebase 2017-02-27 01:30:44 -05:00
Matthew Brown
cd5f727d2e Collect explicit references to classes/methods 2017-02-26 23:09:18 -05:00
Matt Brown
0049e4deb4 Fix #105 and also the issues found in its wake 2017-02-23 19:36:51 -05:00
Matthew Brown
fa3b292fd4 Fix #101 - restrict the values of pass-by-ref variables 2017-02-23 00:25:28 -05:00
Matthew Brown
12cb72ae4b Prevent recursion when checking for initialisations 2017-02-22 00:51:34 -05:00
Matthew Brown
4348888b3e Prevent error when no params are given 2017-02-21 01:56:43 -05:00
Matthew Brown
e61ea17db5 Move FileChecker functionality into separate, better-contained classes 2017-02-18 13:41:27 -05:00
Matthew Brown
81e24de76f Fix invalid NullPropertyFetch warning 2017-02-12 18:06:18 -05:00
Matthew Brown
3f0a87f6fe Add more specific __toString error issue 2017-02-12 13:26:24 -05:00
Matthew Brown
f32fabd798 Remove dead code 2017-02-11 19:30:06 -05:00
Matthew Brown
8ff6634e7b Add issue for possibly unused variables in public/private methods
also changed a lot of access
2017-02-11 18:56:38 -05:00
Matthew Brown
deb11c9402 Change some errors from InvalidReturnType to MoreSpecificReturnType 2017-02-11 18:25:44 -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
8ffd45407c Add support for namespaced templates 2017-02-10 00:14:44 -05:00
Matthew Brown
4a82c0a09a Add support for nested types in templates 2017-02-09 22:57:23 -05:00
Matthew Brown
5e8a40a5a1 Merge pull request #94 from vimeo/template-tags
Add support for templating
2017-02-09 20:51:23 -05:00
Matthew Brown
98b0ed280c Add support for templating 2017-02-09 20:35:17 -05:00