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

69 Commits

Author SHA1 Message Date
Matthew Brown
7c6b1581d3 Add warnings about uninitialised properties to mixed as well 2019-08-11 00:22:28 -04:00
Matthew Brown
90854c4094 Fix broken behaviour when analysing interface test methods 2019-07-28 19:44:36 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Matthew Brown
372a512a86 Don’t convert trait self to trait name 2019-06-26 00:28:43 -04:00
Brown
4a434d9a2f Add separate issue for undefined classes in docblocks 2019-05-15 18:41:26 -04:00
Matthew Brown
c772914910 Add some formatting 2019-03-23 14:27:54 -04:00
Matthew Brown
2f8bfffe95 Fix #1475 but, like, properly this time 2019-03-17 13:50:02 -04:00
Matthew Brown
f66af3e267 Fix #1475 - allow self params in traits 2019-03-17 11:31:04 -04:00
Matthew Brown
ab832207a4 Fix #1453 - traits are not valid classes 2019-03-15 22:12:35 -04:00
Matthew Brown
4ba15ec18d Flip abstract trait analysis implementation checks
Fix #1414
2019-03-02 14:17:26 -05:00
Bruce Weirdan
9bdc9f774f More provider typing 2019-03-02 08:43:19 -05:00
Brown
601f303de2 Fix position of invalid param 2019-02-27 16:00:44 -05:00
Matthew Brown
8650f9eb1a Fix #1356 - improve assertion system to work better on function calls 2019-02-26 01:03:33 -05:00
Matthew Brown
f49be31aeb Fix #1332 - use the correct identifier for trait property resolution 2019-02-18 16:52:09 -05:00
Matthew Brown
c6b3fc512f Don’t throw exception when ignoring trait absence 2019-02-10 16:32:30 -05:00
Matthew Brown
22ec7e537c Fix #1208 - respect inheritance when combining in boolean operation
Also fixes issue reconciling inside trait
2019-01-18 10:08:16 -05:00
Brown
ee366015f7 Fix #1205 - allow traits to override inheritance checks 2019-01-16 10:59:06 -05:00
Matthew Brown
6d462fcb64 Fix #909 - support private trait aliasing 2019-01-13 10:19:27 -05:00
Brown
4d959626d5 Fix #1175 - support trait method visibility changes 2019-01-07 11:53:22 -05:00
Brown
1b740aebb5 Fix #1104 - allow multiple trait method aliases to map to same method 2018-11-30 13:45:49 -05:00
Matthew Brown
47f5f309ad Remove support for get_class($a) === "somestring"
But it works with class constants
2018-11-28 23:59:43 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Matthew Brown
2af7ea05da Fix #897 - understand static class comparisons in is_a 2018-07-17 22:50:30 -04:00
Matthew Brown
5623aa1c19 Don’t memoise assertions - it messes with trait analysis 2018-07-03 00:51:57 -04:00
Matthew Brown
92d31b49ad Add extra test to cover full replacement 2018-06-08 20:07:31 -04:00
Matthew Brown
a2b1838e23 Fix #803 - trait methods are evaluated correctly now 2018-06-08 20:06:05 -04:00
Matt Brown
68dbe509a8 Fix #731 - report issues in files required by the source 2018-05-30 12:23:53 -04:00
Matt Brown
9227e61097 Fix #715 - no redundant condition for is_a(self::class,...) checks inside trait 2018-05-30 10:13:55 -04:00
Matthew Brown
b0733254bb
Use individual type objects for each string (#757)
* Experiment with individual types for each string

* Fix bunch of errors

* Fix a few more issues

* Fix a whole bunch of bugs

* Fix most remaining bugs

* Fix isset warnings

* Fix psalm errors in psalm

* Limit big string size

* Fix falsiness of ints

* Fix issue with type widening, allowing value set in nested if to be altered

* Don’t complain if type is mixed

* Add skipped-for-now test

* Add specific test to address issue
2018-05-18 11:02:50 -04:00
Matthew Brown
77d4629896 Fix #714 - fix trait class constants 2018-05-08 22:32:57 -04:00
Matthew Brown
85747d67a1 Fix issuses found in tests 2018-04-21 17:20:21 -04:00
Radosław Kowalewski
15c1a82d8c Few fixes to make tests pass on windows
* changed / to DIRECTORY_SEPARATOR in expected messages
* cahnged most occurences PHP_EOL to "\n" in tests and src
* added output buffering in test to avoid marking test as risky
2018-04-12 22:41:13 -04:00
Matthew Brown
ccbe9980f5 Fix issue with nested trait methods 2018-03-21 17:39:01 -04:00
Matthew Brown
49c4dd8a5d Fix trait method aliasing 2018-03-21 16:55:31 -04:00
Matt Brown
d9ab5e62d6 Prevent unnecessary warnings when checking trait-required methods 2018-03-14 10:51:13 -04:00
Matthew Brown
3059a54768 Fix #569 - fix trait method mapping bug 2018-03-12 23:37:21 -04:00
Matt Brown
d0a2258806 Fix #508 - make sure trait missing property checks happen on correct file 2018-02-12 10:46:45 -05:00
Matthew Brown
67ef894ecc Add extra trait test 2018-01-21 00:32:45 -05:00
Tyson Andre
43e8703a2e Be strict about matching error messages 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
3f3c1380ee Fix erroneous error about no parent when analysing trait call 2018-01-09 09:22:23 -05:00
Matthew Brown
c1ce543e81 Make sure to clear previously inferred types when rechecking trait statements
Fixes #399
2017-12-17 01:06:12 -05:00
Matthew Brown
122b354c4c Ignore get_class and instanceof checks for arbitrary classes in traits 2017-10-24 00:01:43 -04:00
Matthew Brown
c5952af6f0 Fix bug with trait implementing abstract method 2017-07-28 23:38:57 -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
581cf5f7eb Don’t allow trait to override non-abstract method definition for parent class 2017-07-09 15:54:43 -04:00
Matt Brown
ac70ea31b2 Change test assertion keying 2017-06-29 10:22:49 -04:00
Matthew Brown
bc35f88859 Fix issue with $this instanceof checks in traits 2017-06-23 00:39:37 -04:00