1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
Commit Graph

304 Commits

Author SHA1 Message Date
Bruce Weirdan
19a1005bc3
Forbid most magic methods on enums
Fixes vimeo/psalm#8889

Additionally this fixes case-sensitivity of
MethodSignatureMustOmitReturnType issue

Fixes vimeo/psalm#8888
2022-12-12 03:03:20 -04:00
748a74bb2c Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
kkmuffme
7cdad99645 add RiskyCast 2022-09-19 21:54:16 +02:00
Denis Kuznetsov
93a293c673 Allow any attribute for complex types in schema 2022-08-23 04:19:02 +03:00
Guillaume Messier
ca3d0990be
Add capability to use inclusion files in a different directory for plugins and issueHandlers 2022-08-11 14:36:04 -04:00
AndrolGenhald
c0de59c943 Add simplexml stub. 2022-06-22 01:15:43 -05:00
acdbd3e5b5
Bring back disableVarParsing option 2022-06-06 11:57:04 +02:00
AndrolGenhald
31b4dceaf4 Improve handling of unsupported references (fixes #8018). 2022-05-26 18:28:23 -05:00
Matt Brown
20351c6667 Avoid json_encode when serializing non-UTF8 literals
`\Psalm\Internal\Clause::$hash` basically holds a hash on
arbitrary input literals, used for later comparison. Using
`json_encode` fails when dealing with non-UTF8 literals,
which has been replaced by plain PHP `serialize`.

Resolves: #7771
2022-04-27 01:42:37 -04:00
orklah
ebffd5258a
Merge pull request #7433 from zoonru/maximum_shaped_array_size
Add configuration for maximum size of shaped array
2022-03-15 21:19:05 +01:00
orklah
0fe6eaf5d9 Merge remote-tracking branch 'upstream/4.x' into upstream-master13 2022-02-26 21:26:59 +01:00
m1ke
9d78c3e22a Add threads config to xsd 2022-02-21 10:26:34 +00:00
AndrolGenhald
d09e420939 Add @psalm-check-type and @psalm-check-type-exact.
I initially added these as part of my TryAnalyzer rewrite to allow testing complicated `finally` types like this:
```
$foo = 1;
try {
        $foo = 2;
} catch (Exception $_) {
        $foo = 3;
} finally {
        $bar = $foo;
        /** @psalm-check-type-exact $bar = 1|2|3 */;
}
/** @psalm-check-type-exact $bar = 2|3 */;
```
Using the `'assertions'` in tests doesn't work since the type is different inside the `finally`.

I decided to extract the new annotation from the rest of my changes and do a separate pull request since I think others may find it useful, and it should be much easier to review than the entire TryAnalyzer rewrite.
2022-02-17 10:37:13 -06:00
87d9a01f78 Add configuration for maximum size of shaped array 2022-02-15 14:09:08 +01:00
eb3df40fbb
Add option to disable @var parsing everywhere except for properties. 2022-02-15 10:04:56 +01:00
AndrolGenhald
cc2334f40d More class const improvements.
Add InvalidClassConstType issue as alternative to LessSpecificClassConstType when type isn't contravariant.
Handle final class consts (#6395).
Use double quotes for types in class const issues.
2022-02-13 17:19:25 -06:00
orklah
85fca56850 remove totallyTyped 2022-02-12 10:19:14 +01:00
orklah
fac55576ab Merge remote-tracking branch 'upstream/4.x' into upstream-master7 2022-02-12 09:59:55 +01:00
orklah
dbf47b16c3 deprecate totallyTyped 2022-02-12 09:30:37 +01:00
AndrolGenhald
5c01913456 Remove deprecated loadXdebugStub attribute. 2022-01-27 16:55:20 -06:00
AndrolGenhald
8132b57881 Add XML config options to enable/disable PHP extensions. 2022-01-27 16:31:05 -06:00
orklah
9168cef2d4 Merge remote-tracking branch 'upstream/4.x' into upstream-master6 2022-01-26 21:06:25 +01:00
AndrolGenhald
f9450656e1 Add support for references and improve UnusedVariable checks (fixes #7254). 2022-01-26 12:55:47 -06:00
AndrolGenhald
0b81f46bb1 Fixes after rebasing. 2022-01-25 15:31:09 -06:00
AndrolGenhald
0edf260d8b Improve class constant static analysis.
Add class const covariance support (fixes #5589).
Add check for overriding const from interface in PHP < 8.1 (fixes #7108).
Add check for ambiguous const inheritance.
2022-01-25 15:20:17 -06:00
orklah
7c8441baec
Merge pull request #7123 from AndrolGenhald/feature/942-type-annotate-class-constants
Support type annotations for class consts (fixes #942).
2022-01-25 20:54:40 +01:00
Bruce Weirdan
3a6dc9b458
Merge pull request #7431 from zoonru/disable_suppress_all 2022-01-24 11:25:32 +02:00
orklah
7c4f08067b Merge remote-tracking branch 'upstream/4.x' into upstream-master5 2022-01-23 23:44:04 +01:00
AndrolGenhald
558208e44e Add type checking for class const assignments, fix several other const issues. 2022-01-22 17:06:54 -06:00
AndrolGenhald
c18a155f77 Support type annotations for class consts (fixes #942). 2022-01-22 17:06:53 -06:00
AndrolGenhald
01868a9766 Mark loadXdebugStub as deprecated (removed in #7107). 2022-01-22 16:03:35 -06:00
orklah
af1888b631 Merge remote-tracking branch 'upstream/4.x' into upstream-master4 2022-01-22 17:48:42 +01:00
4cfe1a0773
Add configuration option to disable @psalm-suppress all 2022-01-19 13:24:26 +01:00
d970661182
Add separate issue 2022-01-19 12:20:50 +01:00
orklah
dceaa117cf remove forbidEcho 2022-01-18 18:25:18 +01:00
orklah
5f749c8a33 remove forbidEcho 2022-01-18 18:14:39 +01:00
orklah
b633619a2c Merge remote-tracking branch 'upstream/4.x' into upstream-master 2022-01-14 21:01:25 +01:00
orklah
d786e9deef deprecate attribute forbidEcho 2022-01-14 19:31:03 +01:00
orklah
d52c3f0117
Merge pull request #7163 from dvz/explicit-symlink-resolution
Add explicit `resolveSymlinks` option for project directories
2022-01-10 21:50:08 +01:00
b530f23acc
PHP 8.2: seal all properties by default, add configuration key for lower versions 2022-01-10 10:11:28 +01:00
Bruce Weirdan
55eb4b018b
Dropped removed config entries 2022-01-03 12:41:17 +02:00
Bruce Weirdan
966b6ae2b2
Merge pull request #6808 from orklah/exitFunctions3 2022-01-03 06:04:01 +02:00
orklah
b658b2738f
remove exitFunctions 2022-01-02 15:20:01 +02:00
orklah
4f7c1d05c1
remove support for allowPhpstormGenerics 2022-01-02 15:06:04 +02:00
ff7abec2bd
Fix tests 2021-12-30 12:01:25 +01:00
Tomasz Mlynski
1da6893451
Add resolveSymlinks condition for project directories 2021-12-14 20:25:27 +01:00
Bruce Weirdan
85f2083acb
Flag duplicate constants
Fixes vimeo/psalm#6882
Addresses p1 from vimeo/psalm#6471
2021-11-11 00:44:17 +02:00
Bruce Weirdan
b49c25ae76
Fixed tests
* Added new issue to the config.xsd
* Marked NoEnumProperties as PHP 8.1 issue
2021-11-06 22:22:38 +02:00
orklah
943db37ec2 deprecate exitFunctions in XML 2021-11-04 00:39:09 +01:00
orklah
3db477e3c5 deprecate allowPhpStormGenerics 2021-10-19 23:37:35 +02:00