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

53 Commits

Author SHA1 Message Date
Matthew Brown
94aa51ba6d abstract trait method return type override should not be MethodSignatureMistmatch 2019-01-13 13:27:07 -05:00
Matthew Brown
9f16ab9cb5 Fix issue where documented self param confuses 2019-01-05 08:45:12 -05:00
Matthew Brown
4b9ea5472d Fix #1117 - enforce argument counts on interface __constructors 2018-12-12 22:35:27 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Matthew Brown
99c9be34e1 Type according to parent param types, if no type is given 2018-10-06 14:00:45 -04:00
Matthew Brown
350afe3e7f Fix #998 - use lowercase comparison for method signature checks 2018-09-19 23:12:35 -04:00
Matthew Brown
39870f97c4 Fix #894 - check magic methods with given return types 2018-07-16 20:32:16 -04:00
Matthew Brown
f9ba8d7167 Fix #573 - improve required param message 2018-07-13 20:17:29 -04:00
Matthew Brown
391eef0d9d Remove line 2018-04-21 17:44:23 -04:00
rightfold
e6d9854883 Use example-based test abstraction 2018-04-21 16:04:03 -04:00
rightfold
5c908da55a Check that __clone, __construct, __destruct signatures omit return types
PHP complains when you have a return type declared for these three methods.
2018-04-21 16:04:03 -04:00
Matthew Brown
3771ea206c Fix #648 - stop scanning when encountering a duplicate class 2018-04-07 11:38:41 -04:00
Matt Brown
0bd229a86f Add better checks for trait-related fatal errors 2018-03-13 18:12:05 -04:00
Matt Brown
ef35cfc6fe Fix #566 - check for abstract methods inheriting from non-abstract ones 2018-03-13 12:52:00 -04:00
Matt Brown
95642aafb4 Fix #339 - when a class is also in the callmap, use the user-defined behaviour 2018-02-22 13:42:34 -05:00
Matt Brown
5471b89391 Make array coercion an error 2018-02-21 18:59:31 -05:00
Matt Brown
316dd78e6a Fix #509 - don’t complain about a missing param type when system parent has one 2018-02-21 11:57:52 -05:00
Matthew Brown
de9b90297a Allow inheriting functions with nullable signatures to return void 2018-01-31 19:24:34 -05:00
Matthew Brown
6c38b2fdfe Fix #348 - don’t warn about a little contravariance 2018-01-29 22:29:49 -05:00
Matt Brown
a2d11cce51 Fix static/self return type handling 2018-01-26 13:51:00 -05:00
Matt Brown
5e0a8c4339 Inherit correct self return type 2018-01-26 10:59:30 -05:00
Matthew Brown
9b6b03ff9f Create Config before ProjectChecker, and remove test-specific code from FileChecker 2018-01-21 10:22:04 -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
Matt Brown
b373d6093a Be more lenient with nullable docblock types, allow no return statements 2018-01-08 17:17:49 -05:00
Matthew Brown
6f5a214365 Allow param redefinition, but complain if it differs to parent class 2018-01-05 00:19:35 -05:00
Matthew Brown
12aef22f05 Fix issue where byref differences would not be highlighted 2018-01-04 14:01:17 -05:00
Matthew Brown
17d208bdd5 Increase test coverage 2017-12-30 10:54:01 -05:00
Matthew Brown
0c2b2b69b3 Fix #348 - allow signature return types to be non-nullable if parent is nullable 2017-11-28 23:09:09 -05:00
Matthew Brown
afcbc113c9 Fix #228, fix #336 by improving checking of inherited signatures 2017-11-26 16:03:17 -05:00
Matt Brown
7e8ae33d56 Fix #288 - get rid of MethodSignatureMismatch issues where PHP doesn’t worry 2017-11-13 16:31:33 -05:00
Matthew Brown
dd86513fc5 Fix #271 - remove invalid complaint about private overridden method 2017-11-08 21:27:23 -05: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
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
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
SignpostMarv
82c3a664a8 skip tests that extend SoapClient if SoapClient does not exist 2017-04-11 21:02:18 +01:00
Matthew Brown
41f7dc4a52 Fix #93 - fix MethodSignatureMismatch checks on builtin class methods 2017-02-09 17:49:13 -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
Matt Brown
6e6106c080 Add docblocks to tests 2017-01-13 14:07:23 -05:00
Matt Brown
fbbef2c320 Fix #45 - add issue when optional param used before required 2017-01-13 13:40:20 -05:00
Matt Brown
c104736ead Fix #42 - detect false and null defaults 2017-01-13 12:26:10 -05:00
Matt Brown
c181f47364 Fix #35 and #40 by improving method signature checks 2017-01-13 12:03:22 -05:00
Matthew Brown
17329015dc Discriminate between checking, visiting and analyzing in method names 2017-01-07 15:09:47 -05:00
Matthew Brown
7609ca02c0 Fix #32 by evaluating all class references in files lazily 2017-01-04 23:42:58 -05:00
Matthew Brown
ee4a3882a7 Check method defaults to see whether they match 2016-12-30 23:40:32 -05:00
Matthew Brown
23a414a2b3 Fix test failures 2016-12-30 13:14:17 -05:00
Matthew Brown
8b5e066ba6 Add case-sensitive function names 2016-12-30 13:09:00 -05:00