1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
Commit Graph

73 Commits

Author SHA1 Message Date
Jack Worman
f41da745d1 UnsupportedPropertyReferenceUsage 2023-05-12 14:12:12 -05:00
RobChett
aa85669645 Change the Issue type and add documentation 2023-05-07 11:34:33 +01:00
Bruce Weirdan
98d96fbe9c
Forbid private final methods
Fixes vimeo/psalm#8374
2023-03-03 02:00:09 -04:00
Bruce Weirdan
e6aa63731d
Flag docblock parameters that have no counterparts in function signature
Fixes vimeo/psalm#3166
2023-02-15 22:04:26 -04:00
Bruce Weirdan
ee823619b8
Flag direct constructor calls
Fixes vimeo/psalm#2975
2023-02-15 20:14:00 -04:00
Bruce Weirdan
085e8f6fb2
Forbid implementing some interfaces
- `Throwable` can only be implemented when classes extend one of
  `Exception` or `Error`
- `UnitEnum` and `BackedEnum` cannot be implemented by user-defined
  classes

Refs vimeo/psalm#7722
2023-02-12 02:48:50 -04:00
Jack Worman
56f6dfecc8 Report unused baseline entries 2023-01-17 22:02:21 -05:00
Jack Worman
f9aa2d5ad3 Support constants in traits 2023-01-17 16:37:44 -05:00
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
AndrolGenhald
31b4dceaf4 Improve handling of unsupported references (fixes #8018). 2022-05-26 18:28:23 -05: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
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
AndrolGenhald
e268a05307 Minor fixes after rebasing. 2022-01-26 12:57:19 -06:00
AndrolGenhald
0b81f46bb1 Fixes after rebasing. 2022-01-25 15:31:09 -06:00
AndrolGenhald
7d256975e4 Fix cs/psalm errors after rebase. 2022-01-22 17:06:54 -06:00
orklah
af1888b631 Merge remote-tracking branch 'upstream/4.x' into upstream-master4 2022-01-22 17:48:42 +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
AndrolGenhald
240032568c Add test for issues.md to ensure all documented issues are listed. 2022-01-12 14:29:23 -06:00
edc797d1c2
Add docs 2021-12-30 11:56:16 +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
7e0b489efe
Merge remote-tracking branch 'origin/master' into if-this-is 2021-09-21 12:12:15 +02:00
Bruce Weirdan
7b11024886
Flag invalid backing types for enums
Fixes vimeo/psalm#6428
2021-09-05 20:12:24 +03:00
AndrolGenhald
3ce41d71a4
Clean up issues list, add documentation to help with named variadic confusion. (#5511)
* Clean up issues list, add documentation to help with named variadic confusion.

* Add ComplexFunction and ComplexMethod back to issues list.

I removed them because the documentation files don't exist, but they're used and the documentation just needs to be added.
2021-03-29 15:10:49 -04:00
Matt Brown
62493d5ac3 Update master issue list 2020-11-29 23:23:10 -05:00
Matthew Brown
60ac109c01
Add RedundantPropertyInitializationCheck (#4732)
* Add RedundantPropertyInitializationCheck

* add documentation for RedundantPropertyInitializationCheck (#4734)

Co-authored-by: orklah <orklah@users.noreply.github.com>
2020-11-29 11:57:20 -05:00
Niclas van Eyk
0261024aa6
Initial proposal for psalm-require-{extends, implements} (#4361)
* initial implementation of psalm-require-extends

* Added @psalm-require-implements

* Added shortcode for ExtensionRequirementViolation

* Docs & cofig entries for @pasalm-require-{implements,extends}

* Added requirement violations to issues.md
2020-10-19 15:08:18 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
Olle
3630b4a2f9 Merge remote-tracking branch 'remotes/upstream/master' 2020-08-18 15:59:46 +00:00
Grégoire Paris
2f673fbbd7
Detect redundant identity with true (#3893)
Using === true on a known boolean results in the same boolean.
2020-07-25 17:27:45 -04:00
Olle
4b98bf485e Add doc for ifthisismismatch exception 2020-07-14 18:00:22 +00:00
Andrei Petre
3497ca07b6
Extending final class is prohibited #3037 (#3576) 2020-06-13 00:29:59 -04:00
Brown
3c5b4dec06 Add documentation for MixedClone 2020-05-18 17:20:57 -04:00
Matthew Brown
fddab8919e
Remove dead link
Fixes #3301
2020-05-04 14:50:12 -04:00
Matthew Brown
a1be95dc19
remove dead link 2020-04-05 17:24:05 -04:00
Matthew Brown
f0f9b2d01b Add suffix 2020-03-19 12:34:48 -04:00
Matthew Brown
2f62e2d9f5 Move issues to separate pages 2020-03-19 12:32:49 -04:00
Matthew Brown
7017fe3ca4 Fix indentation 2020-03-16 09:51:45 -04:00
Matthew Brown
96a1a0c04f
Remove cast from docblock example 2020-03-16 09:46:43 -04:00
Matthew Brown
6d8e8ba5e2
Add more suggestions 2020-03-16 09:42:17 -04:00
Matthew Brown
f22f5e38f1
Add a how to fix section for MixedAssignment 2020-03-16 09:30:51 -04:00
Matthew Brown
0aca01faea Improve fix to #2805 2020-03-14 01:09:12 -04:00
Matthew Brown
ef64e6e8eb Improve abstract call handling 2020-03-11 10:36:39 -04:00
Matthew Brown
0d62fbdf98 Detect erroneous abstract static method calls 2020-03-11 10:18:40 -04:00
Matthew Brown
a706f4d722 Fix #2242 - warn when using mutable dependencies 2020-02-22 10:04:46 -05:00
Brown
7d99a15072 Fix #2805 - forbid passing in mutable class to mutation-free context 2020-02-21 18:25:35 -05:00
Matthew Brown
5c3ec7a531 Fix #2696 - make sure static property references are prevented in pure functions 2020-01-27 22:55:20 -05:00
Brown
0f659d996d Add documentation for new issue 2020-01-23 14:33:07 -05:00