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

120 Commits

Author SHA1 Message Date
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
rarila
39402c233d
Return type hints (#7065)
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01:00
ralila
711be643c6 Import instead of using fqn exceptions 2021-12-03 20:29:06 +01:00
Bruce Weirdan
d19aad7db1
Display target PHP version
Historically it was often not quite clear to users what PHP version
Psalm assumes, and why. This PR addresses this issue by printing the
version and where we got it from right before scanning the files.
2021-11-27 02:18:09 +02:00
ralila
fdaed941ad use return type hints instead of php doc "@return void" 2021-11-26 20:59:41 +01:00
orklah
e2bb9859e4 fix tests 2021-11-01 22:27:43 +01:00
Aleksandr Zhuravlev
65407cc10d Got rid of test 2021-09-16 23:07:32 +12:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
orklah
55079e92fe
Mixed contains everything (#5763) 2021-05-14 20:23:54 -04:00
Vincent Langlet
587b144f0e
Check for ParamName even for method with only one param (#5732)
* Check for ParamName even for method with only one param

* Fix tests
2021-05-08 19:33:48 -04:00
Bruce Weirdan
93946d0827
Forbid rejecting named arguments when parent allows them (#5627)
Fixes vimeo/psalm#5622
2021-04-15 06:55:13 -04:00
AndrolGenhald
d4590711d6
Fix object-like array keys when combining string and automatic keys (fixes #5427). (#5428)
* Fix object-like array keys (fixes #5427).

* Fix incorrect return types for tests.

* Fix false positive list with literal int key.
2021-03-19 21:44:44 -04:00
Matt Brown
cafbdb6831 Fix #5264 - use accurate static type when calling parent method in trait 2021-02-23 20:48:22 -05:00
Matt Brown
def7326ae1 Remove static from return type when final
Fixes #5244
2021-02-23 19:06:45 -05:00
Matt Brown
6f30399189 Fix #5070 – fix static return type inference in static methods 2021-01-22 09:58:09 -05:00
Matt Brown
e6dad6e65f Be smarter when choosing inherited param types
Ref #4803
2020-12-10 00:15:37 -05:00
Matt Brown
387ab14bda Use better stubs for Serializable and SoapClient 2020-12-08 11:27:51 -05:00
Matt Brown
db8a3ab846 Fix #4751 - allow MethodSignatureMismatch to be overridable when info comes from docblock 2020-12-02 15:13:28 -05:00
orklah
b6a3282589
Detect redundant cast (#4695)
* detect redundant cast

* fix redundant cast issues

* fix redundant cast in tests
2020-11-25 12:04:48 -05:00
Matt Brown
3dd185e395 Fix #4537 - use more rigorous inerhitance for return and param types 2020-11-12 13:54:27 -05:00
Matt Brown
ec3501b244 Ensure PHP 8 continuation of 7.4 method signature features 2020-10-03 23:34:29 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
877a81f808 Always detect return type mismatches from docblock parents 2020-09-07 16:42:25 -04:00
Brown
6def99d653 Add ConstructorSignatureMismatch issue distinct from MethodSignatureMismatch 2020-08-10 12:26:25 -04:00
Matthew Brown
6085e42fc1 Detect mismatching param names effectively 2020-08-10 09:58:43 -04:00
Brown
c0b0036109 Fix #3934 - prevent unsafe use of new static 2020-08-05 19:39:27 -04:00
Brown
cb94764d22 Prevent false-positive for Exception::__toString overriding 2020-07-02 14:09:56 -04:00
Grégoire Paris
e7b8983b7e
Make Throwable methods overridable (#3203)
Methods from \Exception cannot be overriden, but that does not mean
methods from \Throwable cannot be.

Closes #3202
2020-04-20 17:17:47 -04:00
Brown
4f07a8fc5d Fix false positive in trait comparison in 7.4
Fixes #3042
2020-04-03 15:11:37 -04:00
Brown
467da32f84 Fix instanceof static and isa (static::class) handling 2020-03-24 18:58:15 -04:00
Brown
dbdf7473f4 Fix abstract trait method implementation errors when using self 2020-01-24 11:15:35 -05:00
Brown
0132b3789b Fix #2665 - warn about abstract class interface inheritance issues 2020-01-21 11:46:51 -05:00
Matthew Brown
c50fa27025 Identify trait method access level violations as less serious 2020-01-17 00:28:08 -05:00
Matthew Brown
257ebfd205 Improve trait method mismatch failure rules 2020-01-16 22:36:30 -05:00
Matthew Brown
d1c4c85f97 Support covariant return types & contravariant param types
Fixes #2102 and #2264
2019-11-27 00:19:36 -05:00
Bruce Weirdan
79acbadfad Added InvalidParent issue (#2320)
Refs vimeo/psalm#2304
2019-11-11 00:21:43 -05:00
lhchavez
216f991b0c Normalize stringified type names (#2239)
This change makes stringified types more normalized. Concretely it sorts
all union types, reconciled types, and sorts the keys within object-like
types.
2019-10-17 01:14:33 -04:00
Brown
3de056cdc2 Remove test that’s a bit broken 2019-10-04 14:00:53 -04:00
Jay Klehr
27961045a0 allowing null as type for mysqli real_connect for host and passwd parameters (#2210) 2019-10-04 13:07:28 -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
Brown
b00d51b7db Allow misplaced required params so Psalm still inspects the code 2019-06-07 09:25:12 -04:00
Matthew Brown
790bc53bfd Fix #1681 - interpret parent annotation properly 2019-05-25 11:51:09 -04:00
Brown
0bd4dbcbc4 Bump to PHP 7.1
Fixes #1650
2019-05-16 18:36:36 -04:00
Brown
e7f4a52d2b Use better metric for a properly mismatching type 2019-05-14 16:15:38 -04:00
Brown
30cbcb6c36 Add ImplementedParamTypeMismatch issue
Fixes #1633
2019-05-14 15:44:46 -04:00
Brown
24dbc34bbe Use better solution for inherited more-specific return types 2019-05-09 10:41:30 -04:00
Brown
0e4c8ce482 Split apart TypeCoercion issues, allowing more granular issue filtering 2019-04-25 18:02:19 -04:00
Brown
1348d634ed Improve handling of variadic parameters 2019-04-09 13:58:49 -04:00