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

95 Commits

Author SHA1 Message Date
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
Matt Brown
afe3b936d4 Fix test failure 2018-05-09 15:49:22 -04:00
Matt Brown
ad94761e15 Fix undefined property fetch redundant condition 2018-05-09 12:54:31 -04:00
Matthew Brown
85747d67a1 Fix issuses found in tests 2018-04-21 17:20:21 -04:00
Matt Brown
6afaf5aae9 Make Psalm compatible with PHP Parser 4 2018-04-17 13:06:02 -04:00
Matt Brown
6502eba658 Don’t invalidate object vars after callmap functions 2018-04-13 11:24:59 -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
f15c26d7f4 Change how type impossibilities are treated to improve message types 2018-04-10 01:27:26 -04:00
Matthew Brown
0f0f405b9f Allow mixed property assignment when the user wants it
Fixes #652
2018-04-07 12:13:30 -04:00
Matthew Brown
7a5d4b8516 Fix the right thing 2018-03-20 23:55:26 -04:00
Matthew Brown
67312be2a9 Fix #562 - allow if/else blocks to initialise vars 2018-03-08 09:30:31 -05:00
Matt Brown
09d708981a Add mixed checks to property __set calls 2018-02-21 19:34:21 -05:00
Matt Brown
1df4c3d196 Add DocblockTypeContradiction to find possible issues with docblock types
Fixes #491
2018-02-06 18:44:53 -05:00
Matt Brown
2e443dce85 Revert "Fix private constructor check"
This reverts commit 684eb7923b, because it introduces more problems than it solves
2018-02-05 15:53:39 -05:00
Matt Brown
684eb7923b Fix private constructor check 2018-02-05 13:06:03 -05:00
Matthew Brown
07788076e7 Require all new issues to be documented 2018-01-29 00:39:21 -05:00
Matthew Brown
6bfb27165d Check property defaults again 2018-01-28 21:43:26 -05:00
Matt Brown
72a4f148ff Prevent infinite loops when analysing private functions that call each other 2018-01-24 13:11:23 -05:00
Matthew Brown
9b6b03ff9f Create Config before ProjectChecker, and remove test-specific code from FileChecker 2018-01-21 10:22:04 -05:00
Matt Brown
a253ca68bc Allow array_filter to inspect closure bodies 2018-01-17 16:07:46 -05:00
Matt Brown
2212d7c032 Reinstate $this type after parent call
Fixes #444
2018-01-17 11:00:58 -05:00
Matthew Brown
f3bfb089ad Don’t investigate property mutations if they’re not visible 2018-01-13 01:52:46 -05:00
Matt Brown
2120d258a4 Fix formatting of return type adder 2018-01-11 15:50:58 -05:00
Matt Brown
72848477c2 Add all Possibly* issues to more lenient config
And add granularity to InvalidPropertyAssignment* issues
2018-01-10 10:56:43 -05:00
Matthew Brown
c9173c7da3 Add more specific issues for falsable/nullable invalid return types 2018-01-04 21:36:16 -05:00
Matt Brown
e6aae2f2e2 Fix issue assigning string-typed properties without a string cast 2018-01-02 18:01:59 -05:00
Matthew Brown
d964f96439 Add test that analyses a class with a mapped property 2017-12-30 10:42:06 -05:00
Matthew Brown
57592aca41 Fix #409 - PropertyNotSetInConstructor can be suppressed at the property level 2017-12-27 12:27:59 +01:00
Matthew Brown
45fc9fd5d9 Check LHS of property when RHS is variable 2017-12-18 22:35:03 -05:00
Matthew Brown
dc65c14bc4 Fix properties fetches with self 2017-12-13 22:29:38 -05:00
Matt Brown
eca7351472 Add return-level issues as well as function-level ones
Fixes #379
2017-12-07 15:50:25 -05:00
Matthew Brown
0ea6540018 Fix #358, don’t emit PropertyNotSetInConstructor on public final classes/methods 2017-11-29 23:46:56 -05:00
Matt Brown
1173dcc6a2 Don’t stop reconciling types when encountering problem 2017-11-28 17:42:00 -05:00
Matt Brown
a99135c4d0 Fix #300 - add PossiblyInvalidPropertyFetch 2017-11-15 11:44:13 -05:00
Matt Brown
9111b1c725 Fix #301 - add PossiblyInvalidPropertyAssignment 2017-11-15 11:15:03 -05:00
Tyson Andre
a50783404f Fix build failure - MixedPropertyAssignment should be expected in test.
This is assigning to a property of type mixed?
2017-11-07 17:24:44 -05:00
Matt Brown
81493a639e Add more robust property assignment when property not defined 2017-11-03 12:27:01 -04:00
Matthew Brown
467bbba593 Prevent falsy values from leaking into the type system 2017-10-23 22:04:07 -04:00
Matthew Brown
5bd6228708 Fix #220 - don’t worry about parent property access 2017-09-24 08:17:27 -04:00
Matthew Brown
313e1c383c Fix edge-case issue with abstract class not fully implementing interface 2017-09-13 23:57:11 -04:00
Matt Brown
eee8442af6 Fix #199 - allow classes to suppress PropertyNotSetInConstructor warnings 2017-09-13 11:32:13 -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
67338c4bf5 Also detect non-inherited private constructors 2017-07-08 22:01:26 -04:00
Matthew Brown
c7b0f6685f Make Psalm a bit faster 2017-07-08 21:19:16 -04:00
Matthew Brown
d8654b8389 Slow down Psalm by checking parent initialisations too 2017-06-30 01:24:45 -04:00
Matt Brown
ac70ea31b2 Change test assertion keying 2017-06-29 10:22:49 -04:00
Matthew Brown
878696b72c Fix #173 - don’t emit MissingConstructor issues from trait constructor 2017-06-21 01:25:41 -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