Commit Graph
253 Commits
Author SHA1 Message Date
Jaapio 9f96a9ff69 Add missing tests 2026-01-04 16:26:03 +01:00
Jaapio c1111a0b0a Add tests for factories 2026-01-04 15:34:19 +01:00
Jaapio 3f6d648d7d More phpstan checks for better code 2026-01-01 22:36:45 +01:00
Jaapio bff00aaf74 Remove deprecated arguments
Argument creation was deprecated on the method tag. This is now removed.
2026-01-01 20:56:36 +01:00
Jaapio fba45a3718 More cleanup of tag creation
TagWithType need to be created via a factory now.
2025-12-24 16:16:59 +01:00
Jaapio 02f9ed7a8f Remove deprecated code paths
Typed tags are no longer creatable via the create method. The
parsing has become to complex to handle per tag. This logic has been
moved into factories.
2025-12-23 21:51:08 +01:00
Jaapio 97db20d534 Tests with type resolver v2 2025-12-22 23:04:25 +01:00
Jaap van Otterdijk 90614c73d3 Merge pull request #422 from sbuerk/stefan-1
[BUGFIX] Mitigate "Using null as an array offset is deprecated"
2025-11-27 20:50:05 +01:00
Jaapio 84265c845d Remove outdated test
We support collections of self now.
2025-11-27 20:45:57 +01:00
Stefan Bürk 67d330993f [BUGFIX] Mitigate "Using null as an array offset is deprecated"
Using `DocBlockFactory->create()` with a phpdocblock
hanging a `@throws` tag followed by a exception class
name emits following PHP 8.5.0 deprecation:

```
Using null as an array offset is deprecated,
use an empty string instead
```

in `StandardTagFactory->getArgumentsForParametersFromWiring()`.

This change uses the null-coalsce operator to fallback to
an empty string for the value which should be used as an
array key instead of using `null` to mitigate the deprecation
notice with PHP8.5.0 and matches the behaviour in earlier
PHP versions without the deprecation message.
2025-11-26 22:06:27 +01:00
Jaapio d46c3297fb Fix compatibility issue with phpstan 2.0 parser
The phpstan 2.0 release contains a fix which resolves the existing bug
in the old parser that didn't take the whole description when it was
multiline. Now the workaround is disabled when using phpstan parser v2

Fixes #393
2024-12-07 10:35:23 +01:00
Jaapio d0e946cb14 Fix code style 2024-11-12 12:22:19 +01:00
Christian Flothmann 2a8b28d42a add support for phpstan/phpdoc-parser 2 2024-11-10 22:44:37 +01:00
Jaapio 54e10d44fc Add tests for new tags 2024-11-04 22:26:31 +01:00
Jaapio 6a5a3b7748 Fix codestyle issues 2024-11-04 21:01:58 +01:00
Gautier DELEGLISE 93cfc743bd 💚 removed unecessary imports 2024-10-28 10:30:40 +01:00
Gautier DELEGLISE 992c829bad ♻️ cover more default value cases 2024-10-28 10:28:22 +01:00
Gautier DELEGLISE fde2b5916d method parameter default value rendering 2024-10-26 23:49:53 +02:00
Viktor Szépe ab86695010 Fix typos 2024-05-21 06:10:59 +00:00
Jaapio 8c422ab43b Fix docblock tag descriptions
Newlines and whitespaces were not handled as before. This caused
issues for some users because our indent-recuction was broken.
The cause seems to be an upstream issue in phpstan parser which
is not resolved yet. But this work around post processing the tokens
helps us to make it work as before.
2024-05-21 07:50:53 +02:00
Jaapio 518be131c0 Bugfix: resolve issue with multiline descriptions
The phpstan parser is not consuming the full description when parsing
docblocks with a more complex description. For them it's mostlikely not an
issue as phpstan doesn't use the descriptions. But it will also parse
the descriptions into unexpected tags. This could be an advantage but is
not according to the phpdoc spec.

Our own tokenizer is already tokenizing the docblocks into the correct parts.
So all we needed to do is assume all remaining tokens in the phpstan ast belong
to the description. From there our own code is able to handle this as before in
v5.3.

fixes #365
2024-05-08 20:49:40 +02:00
Jaapio 64e172d8ae Added test for regression on invalid types 2024-04-09 23:09:05 +02:00
Jaapio 08acd34f7e Add test for constant references. 2024-04-08 22:15:57 +02:00
Jaapio edd5f67143 Be more strict about type definitions on param
Throw on invalid type definitions and unexpected type definitions.
Not all types resolved by phpstan's parser are valid for docblocks,
they might in a more complex type system but I do not see how these
types would ever apply to param tags.
2024-04-08 21:38:01 +02:00
Jaapio f359e4f8ef Fix code style 2024-03-20 22:40:18 +01:00
Jaapio 7b2f618fe1 Add test for string value params
shows the correct behavior of #348

fixes #348
2024-03-20 22:16:52 +01:00
Jaapio fc9a2339f2 Implement fallback option for params without variable 2024-03-20 21:57:07 +01:00
Jaapio 98566f2504 Add typeless parameter support. 2024-03-12 22:49:26 +01:00
Jaapio c6d49fc451 Fix code style and bump to php 7.4 2024-03-12 22:28:53 +01:00
Aydin Hassan ae20798fde Fix rendering a description when it contains escaped characters and no tags 2023-10-11 14:57:53 +02:00
Jaapio 29e383a759 Fix issue with missing registered factory 2022-11-14 22:00:05 +01:00
Jaapio 1f95f3b735 Codestyle fixes and static analysis 2022-11-11 14:24:45 +01:00
Jaapio 6a92bc3ce9 Remove type logic from this package 2022-11-11 12:30:14 +01:00
Jaapio d6e90a3238 Add callable parameter support 2022-11-04 15:43:05 +01:00
Jaapio 50bf16734e Add support for constant types.
phpstan supports contant definitions and expressions to
link to constants.
2022-11-04 11:21:53 +01:00
Jaapio 81553b535f Add default types to method tag arguments 2022-10-28 22:37:28 +02:00
Jaapio e4ac07bc40 Add method support 2022-10-28 22:25:08 +02:00
Jaapio cfe9845260 Add property support 2022-10-28 21:07:34 +02:00
Jaapio 1dd491c8ec Add return tag factory 2022-10-28 16:47:01 +02:00
Jaapio 25d696587f Cleanup and var implementation 2022-10-28 16:27:10 +02:00
Jaapio b66b6dc644 Fix some php8+ issues 2022-10-28 14:54:08 +02:00
Jaapio d6c050a533 WIP 2022-10-28 14:05:33 +02:00
Jaapio 7192e67cfa First POC steps 2022-10-14 15:26:54 +02:00
Fabien Villepinte 29ed9ae60d Support reference in method tag 2022-03-31 13:22:11 +00:00
Jaap van Otterdijk d708b18227 Merge pull request #299 from villfa/test/298
Tests: add a case to cover issue #298
2021-09-17 10:37:36 +02:00
Fabien Villepinte 98e82e39fa Tests: add a case to cover issue #298 2021-09-05 18:57:50 +00:00
Jaapio 6fa60f9f08 Fix code style 2021-08-26 22:32:25 +02:00
Jaapio bca4974b0b Make split platform independend 2021-08-26 22:31:30 +02:00
jrfnl 11315744bf CS: blank line between different use statement types 2021-08-08 19:41:03 +02:00
jrfnl a607236134 CS: no whitespace before return type colon 2021-08-08 19:41:03 +02:00