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

187 Commits

Author SHA1 Message Date
HypeMC
ee16caf596 Make template constraints examples in docs consistent 2022-09-17 22:20:01 +02:00
Daniel Schmelz
9c67b85f39
Fix typos 2022-08-20 23:29:03 +02:00
AndrolGenhald
285740a753 Merge branch '4.x' 2022-07-07 15:01:38 -05:00
Barney Laurance
c064edcbb7
use backticks in docs 2022-06-06 18:26:35 +01:00
Barney Laurance
a7c92661fa
Use int<1,max> to define positivity 2022-06-06 17:05:59 +01:00
Barney Laurance
99372a2286
Clarify in docs that zero is not considered a positive-int
I wasn't sure from reading the docs whether or not Psalm consider zero to be positive.
2022-06-06 16:13:30 +01:00
Matt Brown
2ef993928c Document @psalm-ignore-variable-* 2022-04-27 01:46:13 -04:00
Jeremiasz Major
ce25b39b5d
Document @psalm-ignore-variable-* 2022-04-08 00:30:23 +02:00
Jeremiasz Major
23ad8d6684
Fix typos 2022-04-07 21:50:19 +02:00
Jeremiasz Major
f4f1a26cf9
Document @psalm-yield 2022-04-07 21:43:12 +02:00
Patrick Remy
95de0c8dd6
docs: add key-of and value-of to utility types chapter 2022-02-24 18:50:57 +01:00
Patrick Remy
8ebc9b599f
docs: describe template support of properties-of<T> 2022-02-23 21:53:02 +01:00
Patrick Remy
5e74445f70
docs: add utility types chapter 2022-02-22 20:51:17 +01: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
orklah
85fca56850 remove totallyTyped 2022-02-12 10:19:14 +01:00
orklah
841d4f4429 improve support for enum_exists 2022-01-22 18:27:24 +01:00
Bruce Weirdan
e6472deddb
Dropped html-escaped-string docs 2022-01-03 20:54:22 +02:00
Matthew Brown
83911c7408
Remove unnecessary references to empty in TypeCombiner 2022-01-03 04:10:41 +02:00
orklah
0747b48d06
remove TEmpty 2022-01-03 04:09:59 +02:00
AndrolGenhald
dd631c0c85 Skip reference tests, allow assertions on magic properties (fixes #6770). 2021-12-30 16:23:59 -06:00
5fae548e62
Add template support to @psalm-self-out 2021-10-28 10:44:37 +02:00
Mathieu Rochette
3f2733ed2c
Small documentation fix 2021-10-21 15:08:42 +02:00
Bruce Weirdan
f328610142
Update docs/annotating_code/type_syntax/scalar_types.md 2021-10-04 23:45:47 +03:00
sasezaki
f03f362431
Declare html-escaped-string is deprecated on doc 2021-10-04 21:00:54 +09:00
15fccc6a07
Add docs 2021-09-21 17:35:44 +02:00
orklah
4602e4ae22 change definition of list regarding is_list RFC 2021-09-05 23:03:55 +02:00
USAMI Kenta
4985109e56
Remove unnecessary [ 2021-08-12 12:08:00 +09:00
Simon
f80ea4a623 Docs: Add example for method call assertions 2021-07-04 21:34:22 +02:00
Matthew Brown
b1b1072f41
Fix formatting 2021-06-16 11:53:45 -04:00
Matthew Brown
24fc9d8433
Add reference to literal string 2021-06-16 11:53:19 -04:00
Matthew Brown
5f8f249168
Added documentation for literal-string 2021-06-16 11:53:13 -04:00
Matt Brown
ecd5e3b7ae Fix #5652 - use accurate type combination rules when replacing templated union 2021-04-22 00:33:49 -04:00
Benjamin Morel
3d908eda7e
Fix psalm-assert-is-false example (#5659) 2021-04-21 21:32:57 -04:00
orklah
0d524ecd5b
adding documentation about @no-named-arguments and allowNamedArgumentCalls (#5654) 2021-04-21 01:02:25 -04:00
Jacob Dreesen
5777c00073
Add missing opening PHP tag in the docs (#5617)
* Add missing opening PHP tag in the docs

* Fix typo
2021-04-12 23:50:52 -04:00
Matt Brown
012dafad79 Fix #5383 - prevent unsound use of new static for generics 2021-04-10 13:16:19 -04:00
sji
19554de6f6
Add @ignore-var and @psalm-ignore-var (#5488)
* add `@ignore-var` and `@psalm-ignore-var`

* Change two words

Co-authored-by: Matthew Brown <github@muglug.com>
2021-03-26 21:20:23 -04:00
Andrii Dembitskyi
38171934cf
Fix anchor to class-string type in documentation (#5362) 2021-03-11 00:14:57 -05:00
Matthew Brown
1c6a966e40
Remove heading for non-existent annotation 2021-03-01 00:03:59 -05:00
Jacob Dreesen
38d9234781
Fix some typos in the docs (#5245) 2021-02-17 16:37:19 -05:00
Matt Brown
a45b5e2ae0 Add detail about non-empty-string 2021-02-10 12:20:36 -05:00
Jeremiasz Major
e7bfcf8f82
Fix broken links in documentation (#4730)
* Fix links in documentation

* Fix more links
2020-11-28 21:03:09 -05:00
Bruce Weirdan
fc29d26879
Added test to enforce that all supported annotations are documented (#4723)
* Added test to enforce that all supported annotations are documented

Well, at least mentioned.

Refs vimeo/psalm#3816

* Type things

* Make things pretty

* Only check @psalm- annotations, group

* Add documentation for `@psalm-require-extends` and `@psalm-require-implements`

* Dropped logicalOr that has become redundant

* Add explicit tag

* Document @psalm-template

* Add @psalm-template-covariant

* Document `@psalm-method`

* Add list of undocumented docblock annotations

Co-authored-by: Matthew Brown <github@muglug.com>
2020-11-27 21:48:16 -05:00
orklah
f19cac6ecf
add annotation @psalm-param-out (#4717)
* add annotation @psalm-param-out

* add tag in documentation
2020-11-27 17:05:26 -05:00
Matthew Brown
cc5e940b28
Update to more specific example 2020-11-06 17:56:39 -05:00
Matthew Brown
1f84b23f2a
Add @weirdan's fix 2020-11-06 17:53:39 -05:00
Matthew Brown
8f05cc994a
Add aka 2020-10-31 00:18:23 -04:00
Matthew Brown
4966754358
Fix brackets 2020-10-30 23:42:47 -04:00
Marco Perone
641e7d7008
add documentation for pure-callable (#4329) 2020-10-14 19:59:44 -04:00
Leighton Thomas
2b5b255ad1
Fix #3543 - add documentation for @psalm-type and @psalm-import-type (#4291) 2020-10-06 18:58:25 -04:00
Hans-Helge Buerger
8203150a5f
Fix link to template annotations (#4125) 2020-09-04 16:26:52 -04:00
Markus Staab
fc50dd3acb
Docs: added more string types (#4080) 2020-08-28 14:37:46 -04:00
Markus Staab
58141d44ed
Docs: added callable-array (#4079)
* Docs: added callable-array

* Update array_types.md

* Add non-empty-array
2020-08-28 14:37:28 -04:00
Markus Staab
bb1d257aff
docs: added positive integer (#4078)
* docs: added positive integer

* added to toc
2020-08-28 12:55:50 -04:00
Bruce Weirdan
d5055ea1d4
Removed obsolete documenation (#3982)
`allowCoercionFromStringToClassConst` was removed in 3.0 and never
worked since.

Refs vimeo/psalm#3976
2020-08-11 07:30:09 -04:00
Barney Laurance
7ed5e32840
Update docs on @psalm-internal as @internal no-longer has to be used at same time (#3911)
See #42ad366dc8ccaf34
2020-07-30 14:09:14 -04:00
Olle Härstedt
948be8243e
Add @method to docs (#3595)
* Add @method

* Fix links
2020-06-16 22:20:34 -04:00
Matthew Brown
aff2805794
Add annotations ref 2020-06-16 20:55:39 -04:00
wnbsmart
07c7c30ad6
Pass unused created variable (#3560) 2020-06-10 17:28:04 -04:00
feek
a83a6cf3f7
doc --> dog (#3330) 2020-05-10 11:19:54 -04:00
Anton Ukhanev
5b35e022f6
Fix link (#3304)
This fixes link to PHPDoc's type syntax documentation. It appears that they have added an extra URL segment to represent the doc version.
2020-05-06 09:55:57 -04:00
feek
c2a693a034
chore: < > (#3261) 2020-04-28 19:42:06 -04:00
Pierre Grimaud
e7990390a6
Fix typos (#3255) 2020-04-28 09:17:31 -04:00
Brown
c79d64f0c4 A little more unquoting 2020-04-27 23:17:10 -04:00
Brown
11e1adaa99 Fix some escaping 2020-04-27 23:13:43 -04:00
Šimon Podlipský
2a7be233bb
Remove dead link (#3112)
* Remove dead link

* Fix typos
2020-04-09 08:14:43 -04:00
m0003r
28f740fddb
@psalm-trace is now a specific low-level issue, because plain debug print breaks structured output (after #3080) (#3106) 2020-04-08 21:03:05 -04:00
lhchavez
be87bb7300
Support intersection types for object-like arrays (#3064)
This change allows expressing the intersection of multiple object-like
arrays. The resulting type will contain the (merged via intersection)
properties of all the object-like arrays involved in the intersection.

This should allow to express the resulting type of an `array_merge()`
operation, which is tricky to do in the context of a templated type.
2020-04-08 09:35:53 -04:00
m0003r
11edb22c72
Implement @psalm-trace annotation, fixes #3079 (#3080) 2020-04-06 12:42:22 -04:00
Matthew Brown
6ac6c54a34
Fix defaults 2020-04-06 09:28:49 -04:00
Matthew Brown
476b248a1e
Delete docblock_type_syntax.md 2020-04-02 09:41:12 -04:00
Matthew Brown
500b4eb13b
Add content from redundant page 2020-04-02 09:40:17 -04:00
Matthew Brown
194f02507d Allow conditional types to reference class constants 2020-03-29 13:37:37 -04:00
Matthew Brown
9055c4a79b Add documentation for conditional types
Fixes #3005
2020-03-29 11:14:03 -04:00
iggyvolz
94b246b987
Initial commit (#3013) 2020-03-24 18:32:57 -04:00
Matthew Brown
476480ef41 Add opening <?php tags to all PHP snippets 2020-03-21 09:24:41 -04:00
Matthew Brown
c3e94b3e54
Separate formatting
Fixes #2988
2020-03-18 19:15:44 -04:00
Matthew Brown
b2574ad1a3
Add weird break 2020-03-18 19:14:04 -04:00
Matthew Brown
da456b62db
Add more whitespace 2020-03-18 19:12:02 -04:00
Claas Augner
a5f581e294
Fix #2984 - Document Generator type syntax (#2986) 2020-03-18 09:28:32 -04:00
Alexey Kopytko
9e64670e42
Add hyperlink in templated_annotations.md (#2976) 2020-03-15 23:28:37 -04:00
Matthew Brown
106102d0a5
Add line break 2020-02-23 00:41:19 -05:00
Roland Franssen
a7355fa734 Update typing_in_psalm.md 2020-02-07 10:55:44 -05:00
Matthew Brown
b3f6b56f9c Add support for @psalm-readonly-allow-private-mutation 2020-02-02 15:56:08 -05:00
Matthew Brown
93c613b5a3 Adjusted for actual implementation 2020-02-02 15:39:24 -05:00
Christian Kolb
fd6cdf61c7 Update naming to mutate 2020-02-02 15:39:24 -05:00
Christian Kolb
143756800f Add documentation for new @psalm-private-set annotation 2020-02-02 15:39:24 -05:00
HenkPoley
72b5b22474 Mention how to annotate psalm specific annotations (#2648)
* Mention how to annotate psalm specific annotations

Might be nice to mention how to annotate psalm specific annotations, without trampling over PhpDoc annotations.

* Fix key type

Co-authored-by: Matthew Brown <github@muglug.com>
2020-01-17 08:47:21 -05:00
Jacob Dreesen
26bf183430 Fix typos (#2639) 2020-01-16 08:36:18 -05:00
Pavel Batečko
87debfe954 Support suppressing all issues with @psalm-suppress all (#2584)
* Support suppressing all issues using @psalm-suppress all

* Document @psalm-suppress all
2020-01-12 10:38:32 -05:00
LeSuisse
88c496121e Add an example on how to use @psalm-immutable annotation with an anonymous class (#2544)
Related to #2543
2020-01-02 14:09:11 -05:00
Markus Podar
270a99f57d Add sample for optional keys in array shapes (#2538) 2020-01-01 13:53:32 -05:00
Ruud Kamphuis
ca31931a53 Explain bool assertions (#2528) 2019-12-29 09:22:09 -05:00
Matthew Brown
a2a2d8cd97
Delimit quotes 2019-12-21 14:15:02 +00:00
Grégoire Paris
cde7c80786 Spell "covariant" properly (#2487) 2019-12-19 17:49:51 +00:00
Matthew Brown
c2464ebb71 fix link 2019-12-19 10:41:15 +00:00
Matthew Brown
7b6061efe3 Add section on template covariance 2019-12-19 10:36:14 +00:00
Valentin Udaltsov
bb52c4ce75 Update callable_types.md (#2482)
Spread operator must be a suffix in callables
2019-12-19 00:28:04 +00:00
ADmad
065653c58f Fix param name in example (#2317) 2019-11-09 16:26:06 -05:00
Matthew Brown
4ee037923a
add link to lists 2019-10-11 09:58:34 -04:00