Commit Graph

147 Commits

Author SHA1 Message Date
Kuba Werłos
f069ed8028 Allow backslash in PHPDoc tag 2022-09-04 20:59:06 +02:00
Richard van Velzen
af74624406
Support properties/methods in assert annotations 2022-08-09 14:18:55 +02:00
Alex Wells
135607f9cc Support @template-contravariant tags 2022-06-26 15:09:08 +02:00
Jiří Pudil
25ddf938d8 Simplify parsing of type alias import 2022-06-20 10:47:42 +02:00
Richard van Velzen
4a07085f74 Micro-optimize lexer 2022-06-14 13:40:08 +02:00
Richard van Velzen
76150ae751 Optimize generated regex 2022-06-10 11:29:33 +02:00
Richard van Velzen
5aaeb83195 Optimize Lexer::tokenize() 2022-06-10 10:12:59 +02:00
Richard van Velzen
3cb62d1084 Make requiring whitespace before description optional 2022-06-09 11:45:59 +02:00
Richard van Velzen
1e355a35e2
Support all atomic types as nullable types 2022-06-08 21:40:28 +02:00
Richard van Velzen
7c621a2217 Fix parsing phpdoc with no trailing whitespace 2022-06-08 20:03:36 +02:00
Richard van Velzen
9d452051cb
Allow omitting @param type 2022-06-08 20:02:43 +02:00
Richard van Velzen
d579798d2f Require whitespace before description with limited start tokens 2022-06-08 16:53:02 +02:00
Richard van Velzen
28cb38bd06 Implement offset access type syntax 2022-05-05 13:31:11 +02:00
Richard van Velzen
6cafed9212 Add negated assertions 2022-05-04 09:46:54 +02:00
Richard van Velzen
47051f5ca6 Parse assert-if-true and assert-if-false as well 2022-05-04 09:46:54 +02:00
Richard van Velzen
0af5cba9f1 Also expose the tags 2022-05-04 09:46:54 +02:00
Richard van Velzen
8f703ba724 Add assert syntax 2022-05-04 09:46:54 +02:00
Richard van Velzen
129a63b3bc
Extend allowed types for conditional for parameter 2022-04-22 13:11:01 +02:00
Ondrej Mirtes
d8e9fd97ca
ConstExprParser - throw known exception type 2022-04-14 14:24:06 +02:00
Ondrej Mirtes
34545bb30a
Fix memory leak
Exceptions in their stack traces carry references to all unexpected objects
2022-04-08 13:30:34 +02:00
Richard van Velzen
4cb3021a4e Support multiline parenthesized types
This includes union, intersection, and conditional types
2022-03-30 15:33:37 +02:00
Jaroslav Hanslík
05333065c8 Fixed missing parentheses in ConditionalTypeForParameterNode::__toString() 2022-03-29 11:28:16 +02:00
Jaroslav Hanslík
c1f8095e52 Fixed missing parentheses in ConditionalTypeNode::__toString() 2022-03-29 11:28:05 +02:00
Jaroslav Hanslík
f109d1d984 Typo in ConditionalTypeForParameterNode 2022-03-29 11:27:52 +02:00
Jaroslav Hanslík
45df6a5c86 Typo in ConditionalTypeNode 2022-03-29 10:50:06 +02:00
Richard van Velzen
445ccb723c
Support conditional types
* Support conditional types

Part of implementation for phpstan/phpstan#3853

* Add fuzzy tests

* Only support "is" / "is not"

* Rename trueType/falseType to if/else

* Add tests to TypeParserTest

* cs

* Only allow parenthesized conditional types

* Remove multiline support

It'll be easier to implement this for more types properly separately

* Support conditional for parameters
2022-03-28 12:50:35 +02:00
Richard van Velzen
c08946968b Support multiline callable syntax
Closes #46. Tests are basically copied and modified from #44
2022-03-28 09:53:31 +02:00
Renovate Bot
d5a6692b8a Update dependency slevomat/coding-standard to v7 2022-02-08 12:41:11 +01:00
Jean-Luc Herren
4bf544b199 PhpDocNode: Swap array_column() and array_filter()
See phpstan/phpstan-src#948
2022-01-29 18:41:21 +01:00
Ondrej Mirtes
dbc093d7af
Fix BC break vs. 1.0.0 2021-09-16 22:46:02 +02:00
Jordi Boggiano
605e3697d7 Fix wildcard parsing to end if a space follows, fixes phpstan/phpstan#5628 2021-09-16 22:28:27 +02:00
Vincent Langlet
d622b7c550 Add support for reference in phpdoc 2021-09-16 22:27:44 +02:00
Jordi Boggiano
816e826ce0 Allow parsing class constants with more than one wildcard in the constant name 2021-09-12 13:52:00 +02:00
alexndlm
fac86158ff
Do not add space if empty string 2021-08-31 10:08:22 +02:00
Ondrej Mirtes
ea0b17460e
Allow empty array shape 2021-06-11 15:24:46 +02:00
Jiří Pudil
e352d065af type aliases: detect unsupported targets of type alias imports on parsing level 2021-04-03 16:46:19 +02:00
Ondrej Mirtes
7c3115eeb2
Mark TypeParser methods as impure 2021-03-27 12:40:37 +01:00
Ondrej Mirtes
f9f5616cb2
Mark some TokenIterator methods as impure 2021-03-26 19:36:08 +01:00
Ondrej Mirtes
2269e47626
Catch parse exception when consuming TOKEN_CLOSE_PHPDOC 2021-03-22 18:32:47 +01:00
Tomas Votruba
86b0a001af
Fix PhpDocNode end newline print 2021-03-22 17:52:24 +01:00
Ondrej Mirtes
b2169b6c87
Merge branch '0.4.x' into master 2021-03-19 11:54:26 +01:00
Jaroslav Hanslík
cf4fc7d2ae
Fixed "Undefined array key -1" 2021-03-19 11:54:14 +01:00
TomasVotruba
cfe3c783bc
Allow nodes to have custom attributes 2021-03-18 22:19:05 +01:00
Jan Tvrdik
b451b2f27a Preserve whitespace formatting of text nodes 2021-03-15 09:55:35 +01:00
Jiří Pudil
2e17e4a907 type aliases: support @phpstan-import-type and @psalm-import-type tags 2021-02-28 15:30:10 +01:00
Jiří Pudil
2d862ef746 type aliases: support @phpstan-type and @psalm-type tags 2021-02-28 15:30:10 +01:00
Sebastian Schreiber
d2c01c14b2
allow numbers in tags [closes #59] 2021-02-16 08:07:16 +01:00
Tomas Votruba
a2f1a1fc1f
[cs] update coding standard to allow PHP 8 and Slevomat CS 6.4 (#58) 2021-02-08 12:07:58 +01:00
Vincent Langlet
98a088b179 Add support for @phpstan-throws 2020-08-03 22:32:43 +02:00
Jaroslav Hanslík
1948aa842a Fixed parsing description started with HTML tag 2020-06-10 07:04:41 +02:00