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

64 Commits

Author SHA1 Message Date
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
Matthew Brown
645602a38e Properly namespace @property types 2018-02-03 23:10:22 -05:00
Matthew Brown
861d907845 Add more information to TooMany/TooFewArguments issues
Fixes #481
2018-02-02 11:26:55 -05:00
Matthew Brown
8d2baf584e Fix #479 - allow PhpStorm generic syntax behind a config flag 2018-02-01 01:10:27 -05:00
Matthew Brown
3482ee3b39 Split UntypedParam into MissingParamType and MissingClosureParamType 2018-01-28 20:03:47 -05:00
Matthew Brown
507007a2bf Add DeprecatedInterface and emit DeprecatedClass in more places
Fixes #463
2018-01-23 09:09:43 -05:00
Matthew Brown
9b6b03ff9f Create Config before ProjectChecker, and remove test-specific code from FileChecker 2018-01-21 10:22:04 -05:00
Matthew Brown
799aef628e Fix type assignment checks 2018-01-20 11:48:16 -05:00
Matt Brown
9f2a0847a4 Fix #453 - catch bad objectlike type when analysing docblock 2018-01-19 16:06:30 -05:00
Tyson Andre
d688b51534 Be strict about matching word boundaries for expected messages
E.g. don't allow InvalidPropertyAssignmentValue where
InvalidPropertyAssignment was expected
2018-01-11 18:04:11 -05:00
Matt Brown
2120d258a4 Fix formatting of return type adder 2018-01-11 15:50:58 -05:00
Matthew Brown
75daea5f04 Fix #382 - improve reserved word checks 2018-01-10 00:07:47 -05:00
Matthew Brown
6b68da0e4d Always check typehints for bad classes 2018-01-09 22:46:55 -05:00
Matt Brown
b373d6093a Be more lenient with nullable docblock types, allow no return statements 2018-01-08 17:17:49 -05:00
Matt Brown
a76fde5b98 Break out mismatching param/return type issues from InvalidDocblock 2018-01-05 12:11:12 -05:00
Matthew Brown
17d208bdd5 Increase test coverage 2017-12-30 10:54:01 -05:00
Matthew Brown
3b7c84f484 Detect instances where loop invariants are invalidated
Fixes #389
2017-12-17 10:58:03 -05:00
Tyson Andre
136d48f77c Support @property-read and @property-write as new tags. (#317)
In combination with `@psalm-seal-properties`, this can be used to
have in-depth checking of magic properties.
2017-12-14 14:22:27 -05:00
Matthew Brown
1a39224abc Fix issues that improved array checks found 2017-11-19 12:14:02 -05:00
Tyson Andre
1c25ca1a0c Fix false positives, add tests of @psalm-seal-properties (#318) 2017-11-17 16:19:48 -05:00
Matthew Brown
a08306973a Fix #302 - add a way to seal objects with magic properties 2017-11-16 20:47:58 -05:00
Matthew Brown
b2ae9a2892 Fix #291, #292 and #297 by improving docblock parsing 2017-11-14 21:43:31 -05:00
Matt Brown
81493a639e Add more robust property assignment when property not defined 2017-11-03 12:27:01 -04:00
Matthew Brown
a651fad6f0 Fix #263 - add support for @psalm-param and @psalm-var annotations 2017-11-02 21:45:17 -04:00
Matthew Brown
6b4bd47ddb Fix #181 and #225 - resolve problems with self in comments/return statements 2017-10-07 10:22:52 -04:00
Matthew Brown
e89a2929d5 Infer types from numeric operations 2017-09-06 21:44:26 -04:00
Matthew Brown
11aa3558b7 Make sure encapsulated strings can also coerce param types 2017-09-02 19:48:59 -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
73694ab04e Suggest types when complaining of untype params
Ref #204
2017-09-02 18:15:52 -04:00
Matthew Brown
8aabcbce35 Introduce UntypedParam warnings when functions are missing param types 2017-09-02 11:18:56 -04:00
Matthew Brown
22daecb8ad Fix phpcs error 2017-07-26 21:30:01 -04:00
Matthew Brown
df767e80a4 Move onto newline 2017-07-25 19:48:45 -04:00
Matt Brown
76ba419330 Group unused tests together 2017-07-25 17:04:58 -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
Matthew Brown
e60f085741 Fix #178 - complain when encountering bad @return type 2017-07-09 20:32:35 -04:00
Matt Brown
f4338c38e7 Fix #148 - suppress InvalidDocblock where appropriate 2017-06-13 14:00:41 -04:00
Matthew Brown
d6909193ea Add additional formatting changes 2017-05-26 20:05:57 -04:00
Matthew Brown
688a72c794 Fix #36 - emit issues on deprecated properties 2017-05-25 01:32:34 -04:00
Matthew Brown
0fdf281896 Add support for @deprecated classes 2017-05-25 00:34:39 -04:00
Matthew Brown
42b435e23f Fix #134 - warn when docblock type is ill-formatted 2017-05-24 21:11:18 -04:00
Matt Brown
39ece995b6 Add @psalm-ignore-nullable-return annotation 2017-05-10 12:36:11 -04:00
Matt Brown
df890fbfb0 Fix #155 - support @property declaration for classes with magic getters & setters 2017-05-04 18:35:05 -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
f096468536 Don’t forget where a type came from when combining 2017-03-19 14:39:05 -04:00
Matthew Brown
cdcacc395d Rename DeadCode to UnusedVariable, UnusedMethod and UnusedClass 2017-02-08 00:28:26 -05:00
Matt Brown
a7872472be Add stubbing tests and modify config initialisation 2017-01-31 19:22:05 -05:00
Matthew Brown
b3726c9de5 Use getcwd() for the project’s base, not the config file parent directory 2017-01-16 18:33:04 -05:00
Matthew Brown
c78ce31e36 Be more lenient when type left out of docblock 2017-01-15 23:49:58 -05:00
Matt Brown
6e6106c080 Add docblocks to tests 2017-01-13 14:07:23 -05:00