1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 18:36:58 +01:00
Commit Graph

2871 Commits

Author SHA1 Message Date
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
orklah
72de3b66cc
Merge pull request #7003 from rarila/no-phpdoc-return-void
Use return type hints instead of php doc "@return void"
2021-11-26 23:03:28 +01:00
orklah
a27e729263
Merge pull request #7002 from orklah/listkeyedarray
Disable list flag for TKeyedArray after unset
2021-11-26 21:32:55 +01:00
ralila
fdaed941ad use return type hints instead of php doc "@return void" 2021-11-26 20:59:41 +01:00
orklah
4f223db455 Disable list flag for TKeyedArray after unset 2021-11-26 20:52:34 +01:00
orklah
2fbad1bbeb
Merge pull request #6993 from orklah/taint-numerics
Taint can't be transmitted through numerics nor bool
2021-11-25 23:20:38 +01:00
orklah
ab61eae5c9 Taint can't transmit through numerics nor bool 2021-11-25 22:51:35 +01:00
orklah
3bc06a8eab Taint can't transmit through numerics nor bool 2021-11-25 22:40:01 +01:00
Paweł Tomulik
dac8c98613
attempt to fix #6973 2021-11-23 20:26:07 +01:00
orklah
b42c2814a9
Merge pull request #6971 from orklah/empty-keys
fix counting array properties when some are Never
2021-11-23 20:11:47 +01:00
Paweł Tomulik
a7b9a241f3
attempt to fix #6937 2021-11-22 23:24:20 +01:00
orklah
eca56c0c1a
Merge pull request #6972 from orklah/unused-throws
prevent Psalm from considering throwing methods as unused just because they're immutable
2021-11-22 22:00:55 +01:00
orklah
1c1e352e5f prevent Psalm from considering throwing methods as unused just because they're immutable 2021-11-22 21:29:57 +01:00
orklah
0d47722195 fix counting array properties when some are Never 2021-11-22 21:13:25 +01:00
orklah
79fa7f5993
Merge pull request #6953 from orklah/callstatic-pure
check __callStatic purity instead of the pseudoMethod purity
2021-11-21 23:02:07 +01:00
orklah
3e56e859a9 fix inheritance 2021-11-21 21:53:24 +01:00
orklah
41fd460db5 check __callStatic purity instead of the pseudoMethod purity 2021-11-21 13:51:19 +01:00
ralila
fe8f919495 Fix some CS issues 2021-11-15 04:00:38 +01:00
ralila
0d0a06e78f Avoid empty variable names instead of filtering them later 2021-11-15 03:00:08 +01:00
ralila
4fd87f2d77 Allow a comma as separator 2021-11-15 02:59:16 +01:00
ralila
7326f3b125 Remove useless brackets 2021-11-14 23:55:32 +01:00
Bruce Weirdan
45e1a1c69a
Merge pull request #6850 from gharlan/hyperlink 2021-11-14 23:20:09 +02:00
Bruce Weirdan
f5b71a3a5f
Infer mb_strtolower() result as string when encoding is specified
`mb_strtolower()` may return characters we generally consider uppercase
when it's given the encoding argument. This PR makes Psalm to err on the
side of caution and treat the return type as `string` rather than
`lowercase-string` in this case

Refs vimeo/psalm#6908
2021-11-14 03:57:10 +02:00
Ricardo Boss
4a58739e00
Fix typos in message about Attribute usage 2021-11-12 23:11:59 +01:00
Philip Hofstetter
ece2bccf76
don't stop processing for class usage after raising an issue
this fixes #6887
2021-11-12 09:24:39 +01:00
Philip Hofstetter
038df9cebe
detect unevaluated inline-html code after an rearly return
this is a followup after #6876

this fixes #6877
2021-11-10 13:11:50 +01:00
Philip Hofstetter
f407ac846a
do not treat __halt_compiler() as an expression being executed
this fixes #6875
2021-11-10 12:45:12 +01:00
orklah
8d22676627 fix errors 2021-11-09 22:31:40 +01:00
orklah
21591b0f2a fix errors 2021-11-09 21:14:55 +01:00
orklah
db05dfeb4c fix never combination 2021-11-09 20:59:49 +01:00
Thomas Bley
ca2fe166ee Added option to forbid eval() in codebase #6855 2021-11-07 21:06:22 +01:00
Bruce Weirdan
756be3b80c
Merge pull request #6843 from weirdan/enums-as-attributes 2021-11-07 17:53:19 +02:00
Gregor Harlan
ab0049d0ff
ConsoleReport: Add links to open file in editor 2021-11-07 15:04:14 +01:00
sasezaki
5a01c8d601 Added phpcs SelfMemberReference rule, and applied 2021-11-07 15:47:39 +09:00
Bruce Weirdan
68495be147
Forbid declaring enums as attributes
This is in line with current Psalm behavior. We forbid non-instantiable
classlikes as attributes, including abstract classes and classes with
non-public constructors.

Refs vimeo/psalm#6841
2021-11-07 01:47:11 +02:00
Bruce Weirdan
9210bbcdd4
Forbid enum instantiation
Fixes vimeo/psalm#6837
2021-11-07 00:14:37 +02:00
orklah
b08d39e567
Merge pull request #6834 from orklah/unused-in-assert
don't consider calls to methods with assertions as Unused
2021-11-06 22:05:34 +01:00
orklah
e28659eb6c
Merge pull request #6838 from orklah/value_and_name_enum
better understands value and name properties for enum
2021-11-06 22:05:04 +01:00
orklah
18677bb108 better understands value and name properties for enum 2021-11-06 21:49:42 +01:00
Bruce Weirdan
0f8ef45110
Forbid properties on enums
Fixes vimeo/psalm#6472
2021-11-06 21:57:49 +02:00
orklah
9c9669ea44 don't consider calls to methods with assertions as Unused 2021-11-06 19:54:17 +01:00
orklah
ad57516765 create a temporary var for coalescing ternaries 2021-11-05 20:07:35 +01:00
orklah
b7834689e5
Merge pull request #6824 from orklah/session
Makes $_SESSION possibly undefined at the source
2021-11-05 20:07:24 +01:00
orklah
33aab6cc40 allow declaring functions and classLikes after a never-returning call 2021-11-05 18:09:40 +01:00
orklah
6e5f3db06c makes $_SESSION possibly undefined 2021-11-04 22:45:46 +01:00
orklah
fffef80ec1 makes $_SESSION possibly undefined 2021-11-04 22:38:31 +01:00
orklah
915278e253
Merge pull request #6823 from orklah/variable_class
allow assertion to work on $var::class
2021-11-04 20:54:59 +01:00
orklah
834d831915 allow assertion to work on $var::class 2021-11-04 20:44:42 +01:00
orklah
5282e4728b allow assertion to work on $var::class 2021-11-04 20:33:30 +01:00
orklah
cd74f665dc
Merge pull request #6813 from orklah/intTaint
don't register taints for numeric variables
2021-11-04 15:30:52 +01:00