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

8479 Commits

Author SHA1 Message Date
Andrii Dembitskyi
38171934cf
Fix anchor to class-string type in documentation (#5362) 2021-03-11 00:14:57 -05:00
Bruce Weirdan
205fdd197e
Wrap entrypoints into IIFE to protect their variables (#5366)
* Wrap entrypoints into IIFE to protect their variables

Fixes vimeo/psalm#5359

* Add tests for Psalm variable isolation

* Capture environment before registering autoloader
2021-03-11 00:14:22 -05:00
orklah
0a4ad5733b
add stubs for min/max (#5353) 2021-03-11 00:13:17 -05:00
Simon Podlipsky
9793f92ba1
Mark ceil() return type as float (#5355)
https://www.php.net/manual/en/function.ceil.php

The return value of ceil() is still of type float as the value range of float is usually bigger than that of int.
2021-03-11 00:11:32 -05:00
Junaid Farooq
5066377271
Remove duplicate entry for 'amphp/amp' from composer.json file (#5352)
Removes the duplicate entry for 'amphp/amp'  from the require-dev section of _composer.json_ file.
Updates the entry in the require section to the latest version used earlier.
2021-03-11 00:10:23 -05:00
Bruce Weirdan
4f8ba04236
Provide more specific explode() return type (#5350)
Fixes vimeo/psalm#5347

`explode()` now omits `false` from the return type  when separator is a
definitely non-empty string.
2021-03-11 00:09:15 -05:00
Bruce Weirdan
8be77aaa2e
Track variable usage in bool to int casts (#5349)
Fixes vimeo/psalm#4956
2021-03-11 00:08:32 -05:00
Bruce Weirdan
185827a7ab
Continue analysis after unknown exception being caught (#5348)
Fixes vimeo/psalm#5188
2021-03-11 00:08:02 -05:00
Bruce Weirdan
71a0457284
Emit ImplicitToStringCast in more places (#5344)
* Emit ImplicitToStringCast in more places

Fixes vimeo/psalm#5320

`to_string_cast` is set on successful comparison, thus it needs to
always bubble up (it will be ignored in UnionTypeComparator if some part
does not match).

* Fix implicit casts

* Fix handling of string method references in self-out context
2021-03-11 00:07:39 -05:00
Bruce Weirdan
7138678c63
Allow undefined variable detection in arrow functions (#5343)
Previously Psalm would assume that any variable it sees in the arrow
function body is defined (and mixed, if it's not available in the outer
scope). This prevented undefined variable detection. Dropping that
assumption allows it to work.

Fixes vimeo/psalm#5331
2021-03-11 00:06:23 -05:00
Markus Staab
5747f1df14
docs: mention default level (#5340)
* docs: mention default level

* Update error_levels.md
2021-03-11 00:06:02 -05:00
Gregor Harlan
c606c89006
config.xsd: fix default errorLevel (#5339) 2021-03-11 00:05:23 -05:00
Claas Augner
3c66b755e2
Always return type inference summary, even if no files were analyzed due to caching (#5329)
* Fix #5319 – Always return type inference summary

Even if no files were analyzed (e.g. due to caching).

* fix code style
2021-03-06 17:20:01 -05:00
Bruce Weirdan
65f0fb0288
Allow multiple version-dependent method stubs (#5337)
Fixed vimeo/psalm#4836
2021-03-06 17:18:51 -05:00
Matt Brown
c97ee5ccdb Fix #5258 - allow ReflectionParameeter::hasType() to inform getType() return 2021-03-06 16:54:23 -05:00
Matt Brown
ca331f5afa Consolidate assertion sanitisation 2021-03-06 16:43:11 -05:00
Matt Brown
c05a3ea073 Break up CoreGenericClasses 2021-03-06 16:05:14 -05:00
Bruce Weirdan
beca4a127f
Suppress test issues with Symony functions used with ::class constant (#5335)
These appeared in symfony/symfony#40203
2021-03-06 15:29:15 -05:00
Matt Brown
96e0743892 Fix #5325 – remove all memoised methods when calling a method with property mutations 2021-03-05 00:39:25 -05:00
Erik Booij
7793d4bec0
Update mysql_connect_error() return type definition (#5323) 2021-03-05 00:09:00 -05:00
Sergei Morozov
9bde1d9107
Fix PDOStatement::fetchAll() return type (#5317) 2021-03-05 00:08:42 -05:00
Matt Brown
4c65d3b424 Fix #5310 - allow iterable coercion from generic object 2021-03-03 00:13:00 -05:00
Bruce Weirdan
a284933c43
Be even less quiet about git errors (#5309) 2021-03-02 22:25:37 -05:00
Bruce Weirdan
841efbdfaf
Make WeakMap generic (#5313) 2021-03-02 22:25:19 -05:00
Sergei Morozov
594ef4fdbf
Fix mysqli_init() return type (#5306) 2021-03-01 22:50:11 -05:00
Bruce Weirdan
217b49a8a8
Fix suppressed phar build error (#5304)
This fixes the log noise due to `cp` syntax error. Possibly it will also
cause phar signatures to be available on `psalm/phar`.
2021-03-01 22:49:52 -05:00
Ilija Tovilo
27e7fb554a
Fix gd CallMap for PHP 8 (#5271) 2021-03-01 11:23:45 -05:00
404db2bb1a
Fix JSON reports with long UTF8 strings (#5300)
* Fix JSON reports with long UTF8 strings

* CS fix

* UTF8-safe snippets
2021-03-01 11:23:21 -05:00
Matthew Brown
ad8c04ce17
Add section about verifiable docblocks 2021-03-01 00:14:24 -05:00
Matthew Brown
1c6a966e40
Remove heading for non-existent annotation 2021-03-01 00:03:59 -05:00
Matt Brown
f5ed12f038 Fix tests by removing references 2021-02-28 23:58:21 -05:00
Matthew Brown
3e3a44b479
Update philosophy.md 2021-02-28 15:09:19 -05:00
Matthew Brown
a1be12886e
More thoughts 2021-02-28 14:57:49 -05:00
Matthew Brown
21742497d6
Add header 2021-02-28 14:49:53 -05:00
Matthew Brown
073c73e700
Update philosophy.md 2021-02-28 14:46:02 -05:00
Matthew Brown
f074be9df2
Update philosophy.md 2021-02-28 14:43:55 -05:00
Matthew Brown
21306848dc
Update philosophy.md 2021-02-28 14:41:54 -05:00
Matthew Brown
0920e46f5e
Fix links 2021-02-28 14:38:55 -05:00
Matthew Brown
e6d9791544
Update philosophy.md 2021-02-28 14:35:14 -05:00
Matthew Brown
9eea78bf60
More link fixes 2021-02-28 14:34:59 -05:00
Matthew Brown
a73fd8ca6d
fix link 2021-02-28 14:34:14 -05:00
Matthew Brown
be1e6949b8
Numbers are lame 2021-02-28 14:32:48 -05:00
Matthew Brown
4147d96881
Update philosophy.md 2021-02-28 14:32:10 -05:00
Matthew Brown
544a6f3b6c
Fix nesting 2021-02-28 14:09:19 -05:00
Matthew Brown
fafa584ad3
Add link to philosophy doc 2021-02-28 14:04:33 -05:00
Matthew Brown
26338350d9
Update philosophy.md 2021-02-28 14:02:18 -05:00
Matthew Brown
ca57e80e30
Add philosophy doc 2021-02-28 13:58:32 -05:00
Matt Brown
3f4bb25a35 Simplify reference map updates 2021-02-28 10:36:36 -05:00
Matt Brown
8b5898029d Add more tests for robustness 2021-02-28 10:36:18 -05:00
Matt Brown
ad82c93edb Fix #5297 - be more sensitive to additions and deletions in language server mode 2021-02-28 01:36:06 -05:00