1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 08:49:52 +01:00
Commit Graph

256 Commits

Author SHA1 Message Date
Matthew Brown
dc053e699b Fix resolution of same-namespaced classes 2018-01-07 17:25:23 -05:00
Matthew Brown
0e67aae21b Allow updating of params 2018-01-07 17:25:23 -05:00
Matthew Brown
5bae869dc6 Break file manipulation out into Psalter 2018-01-07 17:25:23 -05:00
Matt Brown
928b01a7c7 Find and fix code issues where functionality is available 2018-01-07 17:25:23 -05:00
Matt Brown
a76fde5b98 Break out mismatching param/return type issues from InvalidDocblock 2018-01-05 12:11:12 -05:00
Matthew Brown
2ebf6a0ef5 Allow non-lethal method signature mismatches to be suppressed 2018-01-05 01:04:07 -05:00
Matthew Brown
40587292a5 Don’t warn about wider child param types 2018-01-05 00:55:48 -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
c9173c7da3 Add more specific issues for falsable/nullable invalid return types 2018-01-04 21:36:16 -05:00
Matthew Brown
6cff92d813 Don’t worry about invalid closure docblocks 2018-01-04 20:35:43 -05:00
Matthew Brown
a8ac9d4fdc Flesh out return types before comparing 2018-01-04 20:13:09 -05:00
Matthew Brown
5995de0c9f Fix possible nullref 2018-01-04 19:31:12 -05:00
Matthew Brown
6e7bab58c4 Be better about inherited core method arg types 2018-01-04 18:58:03 -05:00
Matthew Brown
12aef22f05 Fix issue where byref differences would not be highlighted 2018-01-04 14:01:17 -05:00
Matt Brown
310f91ea81 Warn when methods with typehints don’t return for all codepaths 2018-01-02 16:57:40 -05:00
Matthew Brown
81cfe09fae Improve reporting of classlike locations in docblocks 2018-01-01 20:04:03 -05:00
Matthew Brown
752e99ad2e Reduce PossiblyUnusedParam false positives 2017-12-30 08:47:00 -05:00
Matthew Brown
f81642c1eb Fix location of function param vars 2017-12-29 21:28:21 -05:00
Matthew Brown
875bb8c072 Improve dead code detection, reducing false positives for params 2017-12-29 17:27:16 -05:00
Matthew Brown
8efc939a5f Move Psalm execution code into PHP file that Psalm can analyse 2017-12-29 17:02:56 -05:00
Matthew Brown
2011b8fb8f Remove dead code 2017-12-16 10:51:04 -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
df90d72ad1 Emit return type errors at the function itself, not its parent
Fixes #363
2017-12-06 00:11:05 -05:00
Matthew Brown
52fc81e4ab Remove need for a __toString return type
Fixes #364
2017-12-05 23:47:50 -05:00
Matthew Brown
a8a1489a8f Fix closure naming convention so it doesn’t confuse method id checks 2017-12-05 01:47:49 -05:00
Matthew Brown
cff7f35d00 Change __toString type conversions to more precise getId checks 2017-12-03 12:44:08 -05:00
Matthew Brown
cb9079ca88 Improve generic param replacement 2017-12-03 11:23:40 -05:00
Matthew Brown
cfeb4c2586 Simplify vars_possibly_in_scope types 2017-12-02 13:32:20 -05:00
Matt Brown
062d46c132 Update to latest php-cs-fixer 2017-11-30 19:00:09 -05:00
Matthew Brown
52f9225356 Add separate issues for implemented return type mismatch 2017-11-30 00:01:41 -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
f27bd50abe
Add RedundantCondition issue, replacing FailedTypeResolution (#344)
* Group changes

* Don’t worry about vars defined before exiting

* Fix issues with vars defined in conditionals

* Add failing test

* Only add failed reconciliation flag if nothing could be salvaged

* Avoid notice when removing clauses

* Improve handling of loops

* Fix evaluation of binary op expressions

* Remove unset vars from outer context after loop

* Ignore RedundantCondition in some more configs
2017-11-28 00:46:41 -05:00
Matt Brown
8b0d99e28b Fix extending of core classes that do bad things 2017-11-27 11:43:06 -05:00
Matthew Brown
afcbc113c9 Fix #228, fix #336 by improving checking of inherited signatures 2017-11-26 16:03:17 -05:00
Matthew Brown
c86e73ddb6 Always keep track of referenced var ids
which we can use for analysis elsewhere
2017-11-24 12:17:28 -05:00
Matthew Brown
4312ef380b Fix issues found by improved Psalm checks
cc @TysonAndre, found with RedundantCondition checks
2017-11-24 12:10:30 -05:00
Matthew Brown
df06c64b3e Allow suppression of InvalidToString 2017-11-21 21:53:12 -05:00
Matthew Brown
e3b688b06d Fix #316 - self resolves to proper class 2017-11-21 21:50:39 -05:00
Matthew Brown
942bc0a663 Add new MixedTypeCoercion issue, fixes #320 2017-11-19 13:42:48 -05:00
Matthew Brown
440db3be89 Fix #313 - correctly analyse closure self return types 2017-11-16 20:06:00 -05:00
Matthew Brown
160a95a8bf Fix too-long line 2017-11-13 21:21:54 -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
Tyson Andre
e2dd3db70f Fix phpdoc in psalm's codebase referring to missing params. (#273)
Also, don't use `@return self` in __construct, it returns void.
2017-11-08 23:32:22 -05:00
Matthew Brown
765d82548d Remove more dead code 2017-11-08 23:27:51 -05:00
Tyson Andre
b3505cfbef Get rid of unused variables in psalm's codebase (#272)
* Remove unused variables

* Fix more unused variables

* Fix remaining detected undefined variables

Other 20 detected undefined variable warnings were false positives.
2017-11-08 23:14:27 -05:00
Matt Brown
8b7d82ddf6 Fix #2 - suppress errors for single lines 2017-10-26 18:19:19 -04:00
Matt Brown
c850ef644d Add PossiblyFalseReference and PossiblyFalseArgument issues
Useful for catching error cases
2017-10-23 11:47:00 -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
1cc13bdeeb Prevent TNamedObject from having a leading slash 2017-10-06 23:35:16 -04:00
Matthew Brown
e42e590442 Add more descriptive exception messages 2017-09-20 08:43:54 -04:00