packagist phpdocumentor/reflection-docblock 5.4.0

latest releases: dev-dependabot/composer/phpstan/phpdoc-parser-2.0.0, 5.x-dev, 5.6.0...
7 months ago

More type support

Since the beginning of this package we have been working on our own parser. Mostly regular expressions spitting each part of a docblock and processing them separately in each tag. But since static analyzers became more popular it became a lot harder to cover all the new formats of types. In type-resolver 1.7 we already started using phpstan's parser to process types. And now in this release we also cover parts of the docblock parsing process with their parser. This will make it easier to keep up with all the new changes and allows us to support more complex type formats.

We do not support all types covered by phpstan. Generics are not fully supported on all notations, we will return an InvalidTag in those cases.

Deprecations

Param tag

We spend a lot of time to cover all the edge cases that we supported in docblocks for many years. However we also noticed that some notations do not really make sense. First notation added to the list is a @param tag without a variable.

@param MyType Here starts the description but $var is ommited

This notation is now deprecated, and support will be removed in the first release of v6.

Static factory interface

We introduced a new factory strategy to make it possible to have more complex factories for tags and keep the implementation simple. Due to this new system of creating tags we can now support external parser to cover the body of a tag to be handled. With this new system the older system of StaticFactories has become deprecated. And will be removed in v6.

Backward compatibility

We introduced all new functionality with backward compatibility in mind. There are no interface changes being made so consumers of the library will not notice anything from the internal changes. However since we introduced a large amount of new types you might notice issues depending on your implementation. Especially when your project reads the types provided by this library.

Other notable changes

New Contributors

Full Changelog: 5.3.0...5.4.0

Don't miss a new reflection-docblock release

NewReleases is sending notifications on new releases.