46 Commits
Author SHA1 Message Date
Jaapio cd04bb47b5 Add docs 2026-01-05 20:49:06 +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 97db20d534 Tests with type resolver v2 2025-12-22 23:04:25 +01:00
Jaapio 84265c845d Remove outdated test
We support collections of self now.
2025-11-27 20:45:57 +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 54e10d44fc Add tests for new tags 2024-11-04 22:26:31 +01: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 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
Jaapio 29e383a759 Fix issue with missing registered factory 2022-11-14 22:00:05 +01: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
Jaapio bca4974b0b Make split platform independend 2021-08-26 22:31:30 +02:00
Jaap van Otterdijk 78dca37266 Merge pull request #285 from jrfnl/feature/tests-annotate-no-assertions
Tests: mark test without assertions as such
2021-08-01 22:21:35 +02:00
jrfnl 6eee464f8d Tests: fix missing @covers tag
... or rather add the missing `@coversNothing` as this is an integration test.

This prevents the test from being marked as "risky" due to the missing tag on PHPUnit 9.x:
```
There was 1 risky test:

1) phpDocumentor\Reflection\DocblockSeeTagResolvingTest::testResolvesSeeFQSENOfInlineTags
This test does not have a @covers annotation but is expected to have one
```
2021-08-01 14:17:11 +02:00
jrfnl 36f4124fa4 Tests: mark test without assertions as such
... to prevent it from being considered "risky" and being listed as "risky" below each test run.

```
There was 1 risky test:

1) phpDocumentor\Reflection\ModifyBackTraceSafeTest::testBackTraceModificationDoesNotImpactFunctionArguments
This test did not perform any assertions

/home/runner/work/ReflectionDocBlock/ReflectionDocBlock/tests/integration/ModifyBackTraceSafeTest.php:15
```
2021-08-01 14:16:50 +02:00
Jaapio 73650dde91 Fix FQSEN resolving on see,covers,uses
The See, Covers and Use tags can reference also methods, properties and
constants. Which means that the FqsenResolver cannot handle those properly.
This patch fixes that issue.
2020-09-02 22:48:30 +02:00
Jaapio 6ff90eb7bd Fix issue with modified backtrace
php allows the backtrace arguments to be modified via the
backtrace. By using array_map we make sure that we do not overwrite
references.
2020-08-12 18:07:00 +02:00
Jaapio 9781068ce1 Move away from phropecy since it is not php8 ready 2020-07-20 21:20:51 +02:00
Jaapio aee984014b Apply new code style 2019-09-20 10:54:12 +02:00
Michael Knappe 6907decc71 added test for generic tag to parse description with 0 as expected 2019-04-30 13:22:06 +02:00
Chuck Burgess d9952bd114 initialize variables before include, so that var tag usage is normal 2018-01-29 14:03:51 -06:00
Chuck Burgess 7bd0e7e4a1 extra space 2018-01-07 09:09:21 -06:00
Chuck Burgess 2f482c78b0 add tests for bug #63; 2018-01-07 08:50:54 -06:00
TomasVotruba 1c8f795c0e apply coding standard to code 2018-01-02 13:40:57 +01:00
Gabriel Caruso a1e6160b99 Welcome 2018 🎉 2018-01-02 04:52:36 -02:00
TomasVotruba 4a9675841b add PHP 7.1 typehints 2017-11-30 10:27:01 +01:00
TomasVotruba a1d8751ad6 tests: add strict_types and typehints, remove tests that are now covered by typehints 2017-11-30 10:27:01 +01:00
Gabriel Caruso 7524aba21f Fix tests 2017-11-15 08:29:42 +01:00
Gabriel Caruso c006d4a2d5 Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase 2017-11-15 08:29:42 +01:00
TomasVotruba 5ff9ca38c5 [cs] finalize, spaces, concat and strict comparison 2017-11-12 21:23:54 +01:00
TomasVotruba a872e515bb [cs] add and apply psr2 2017-11-12 21:23:54 +01:00
TomasVotruba 44c0ac7d5f [cs] remove unused imports, short array and order imports on tests 2017-11-12 21:23:54 +01:00
Roberto Espinoza a8d791f8c9 Check tag body has a value before trying to access it as an string array 2017-08-08 08:43:50 +02:00
Jaapio 183824db76 Restores future support for annotations
In #89 the regex to parse tags was to strict. The first character after a tag
had to be a single string. Annotations typically start with a parentheses. Only character not
allowed after a tag is a [.
2017-08-04 22:55:59 +02:00
Mike van Riel ed4c6b77ab Write example on escaping values in a DocBlock 2015-06-28 19:49:32 +02:00
Mike van Riel 216cf0025f Add example on writing your own Tag and prepare for TagFactory objects 2015-06-28 11:56:16 +02:00
Mike van Riel a6ffa93e28 Add example and functional test for reconstituting a DocBlock 2015-06-27 16:47:47 +02:00
Mike van Riel cff8a80680 Add integration test and example on how to read tags 2015-06-24 22:50:12 +02:00
Mike van Riel 97c3735b32 Add first integration test 2015-06-24 08:42:24 +02:00