1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
Commit Graph

5865 Commits

Author SHA1 Message Date
Brown
67f9adb33c Allow adding pure annotations to functions
Ref #4036
2020-08-23 10:28:26 -04:00
Michel Hunziker
3538fe1955
Add configuration attribute to find unused @psalm-suppress (#4041) 2020-08-22 10:01:26 -04:00
Bruce Weirdan
1f54c42a4c
Don't hang when pcntl_fork is disabled (#4039)
* Don't hang when pcntl_fork is disabled

Fixes vimeo/psalm#3951

* fix CS
2020-08-22 10:01:00 -04:00
Bruce Weirdan
5bf7cc6434
Resolve typedefs that are used in var docblocks of foreach (#4037)
Fixes vimeo/psalm#4029
2020-08-22 08:20:05 -04:00
Tyson Andre
e62e964167
Set up taint analysis for pgsql functions (#4021)
I noticed that entries in InternalTaintSinkMap don't warn
unless the functions are added to CallMap.php
e.g. `pg_exec($conn, $_GET['query']);`
(pg_exec is an alias of pg_query)
2020-08-19 10:41:02 -04:00
Brown
45d9ab12e1 Fix #4017 - allow float defaults in namespaced classes 2020-08-18 12:13:27 -04:00
Brown
ebe37392eb Fix #4019 - new static isn’t static if class is final 2020-08-18 11:25:11 -04:00
Bauke van der Woude
7ac6d2e5a4
Fix hash_*() signatures (#4014)
Functions can return false when an invalid algorithm is supplied
2020-08-18 09:35:31 -04:00
Brown
1468a28273 Fix #3999 - allow @psalm-type to reference imported type right above 2020-08-18 09:34:07 -04:00
Brown
134955a5f4 Fix #4011 - prevent mixed assignment in loop 2020-08-18 08:51:09 -04:00
Daniel Melchior
17ed440f2e
fix #4013: prevent exception when two mixins declare methods with same name (#4018)
fixes #4013
2020-08-18 08:38:30 -04:00
SignpostMarv
9822043ca4
flag class_exists as impure per vimeo/psalm#3975 (#4004)
`class_exists()` interacts with PHP's autoloader feature, which allows
user-defined behaviour to take place when PHP tries to load a given
class or interface.
2020-08-17 15:48:48 -04:00
Gabriel Ostrolucký
81a117be85
Mark fgets impure (#4006)
This function is used to skip line of text
2020-08-17 15:48:28 -04:00
Brown
12798d1cab Prevent access to possibly unset var 2020-08-17 15:25:13 -04:00
Brown
11f170acb4 Don’t modify object after unnecessary assertion 2020-08-16 23:38:59 -04:00
Bruce Weirdan
7adc25c421
Improve import errors (#3997)
* Better errors for invalid type imports

Fixes vimeo/psalm#3885

* Finishing touches

Docs, schema, CS

* Drop unused import

* Drop more unused imports
2020-08-16 22:53:53 -04:00
Brown
bb3c5d4c38 Fix too many arguments 2020-08-16 21:10:09 -04:00
Bruce Weirdan
22d8f5a0bc
Fixed duplicate shortcodes (#3996)
Also added an utility to help assign new shortcodes and a test to
prevent duplicate shortcodes.
2020-08-16 16:26:54 -04:00
Matthew Brown
cb243778d2 Fix #3917 - allow comparisons between classes and interfaces 2020-08-16 16:25:59 -04:00
Matthew Brown
38af5db8f0 Fix #3929 - merge expanded types where necessary 2020-08-16 16:12:29 -04:00
Matthew Brown
e972319f8c Remove unused variable 2020-08-16 14:22:11 -04:00
Matthew Brown
5c20a5295e Improve solution to #3964 2020-08-16 13:03:30 -04:00
Matthew Brown
ec2178d14a Fix #3927 - prevent crash with bad type ref 2020-08-16 12:43:46 -04:00
Matthew Brown
a356a43a51 Fix #3964 - prevent incorrect intersection of unions 2020-08-16 12:26:07 -04:00
Brown
ec70d6f698 Clear out new_storage classlikes 2020-08-15 15:45:54 -04:00
Matthew Brown
a0bb5ed37d Fix #3991 - fix test 2020-08-15 14:21:24 -04:00
Matthew Brown
8731b10bc6 Use older method 2020-08-15 10:31:24 -04:00
Brown
61a0832c05 Fix type bug 2020-08-15 09:41:21 -04:00
Brown
f12f4c8cb3 Fix issues 2020-08-15 01:18:29 -04:00
Brown
cdef4ec351 Alter docblock params too 2020-08-14 16:26:55 -04:00
Brown
dbcf154036 Add fixer for mismatching param names 2020-08-14 15:25:21 -04:00
Matthew Brown
72ecb57def Improve names of things 2020-08-14 00:27:33 -04:00
Brown
209d17c868 Fix #2891 - treat autoloaded constants better 2020-08-13 09:14:27 -04:00
Brown
42c3a703b5 Fix #3741 - detect scalar class constants in if-true assertions 2020-08-12 17:03:41 -04:00
Brown
2a13397904 Find unused code in language server if enabled via config
Fixes #3987
2020-08-12 16:29:15 -04:00
Brown
966a3522ff Move words 2020-08-11 14:36:59 -04:00
Toshiyuki Goto
22b339304d
Normalize file_path with uriToPath (#3984)
Fix #3983
2020-08-11 07:32:24 -04:00
feek
7fe7146dc3
docs: provide some background as to what certain hooks are for (#3978) 2020-08-11 07:29:45 -04:00
m0003r
e81593f359
Localize types on magic properties (#3971)
* Fix #3949 - localize types on magic properties

* fix failing tests

* fix code style

Co-authored-by: m03r <m03r@m03r.net>
2020-08-10 12:45:21 -04:00
Brown
1533debe86 Fix style thinggs 2020-08-10 12:43:19 -04:00
Brown
6def99d653 Add ConstructorSignatureMismatch issue distinct from MethodSignatureMismatch 2020-08-10 12:26:25 -04:00
the-toster
5bdc9723ff
fix for DeprecatedClass suppress on property (#3962)
* add test case for DeprecatedClass suppress on property

* fix test case for DeprecatedClass suppress on property - suppress MissingConstructor also

* ugly way to fix - double analyze propery statement to get dockblock + fix in TypeChecker - respect given suppressed_issues in checkNamedObject

* replace double analyze propery with direct DocBlock manipulation

* replace double analyze propery with direct DocBlock manipulation

* add exception handler to keep original addContextProperties behavior

* correct way to unwrap value from array
2020-08-10 10:50:37 -04:00
lhchavez
ab3016af6e
Fix File-related analysis plugin hooks (#3970)
This change does a few things:

* Renames `BeforeAnalyzeFileInterface` to `BeforeFileAnalysisInterface`.
* Adds a few more parameters to `BeforeFileAnalysisInterface`.
* Since the analysis was never called due to a bug, the above two
  changes are safe to do.
* Fix the above-mentioned bug, and now adds the hooks to the config.
* Update the documentation about the File-related analysis plugin hooks.
* Add a test to ensure that this does not break again in the future.

Fixes: #3969
2020-08-10 10:49:53 -04:00
Matthew Brown
6085e42fc1 Detect mismatching param names effectively 2020-08-10 09:58:43 -04:00
Matthew Brown
50cc3a8afa Align paramter names 2020-08-09 23:19:59 -04:00
Matthew Brown
73321339a3 Bump nikic/php-parser 2020-08-09 16:23:43 -04:00
kazusuke sasezaki
90a50be9f0
quit using combineUnionTypes, when specific TSend provided. (#3966) 2020-08-09 08:26:10 -04:00
the-toster
3a1c861c43
minor: typo in message (#3960) 2020-08-08 08:08:57 -04:00
Brown
166134aca3 Fix bug I added 2020-08-07 15:13:03 -04:00
ygottschalk
f831ebdbcf
narrowed reset and end return type (#3950)
* narrowed `reset` return type
BUT psalm seems to ignore the stub

* narrowed `reset` and `end` return type, this time for real

* fixed UnusedVariable Issue

* fixed RedundantCondition Issue
caused by `end`s return type being more precise

* Improve solution slightly

Co-authored-by: Matthew Brown <github@muglug.com>
2020-08-07 12:23:20 -04:00