Releases: phpDocumentor/Reflection
6.0.0
6.0.0
In this version we added support for Attributes
and improved the way this project can be extended using Reducers
. Added support for php 8.3 features and upgraded to version 5 of phpparser.
Attributes
In PHP8 attributes were added to the language. Attributes are great at runtime but kinda hurdle to take in reflection of the code base as we do not load any classes into our runtime. We are just processing your code as it was plain text. This means that attribute classes are not available as classes, but also a lot of information is gone that you would normally have when loading attributes.
In this version we added a way to support reflection of attributes describing the format of the defined attributes and their call parameters. CallParameters
have an optional name if named parameters are used in the usage of an attribute. This should give our users enough information to get everything out. More features will be added in the future.
Reducers
During the development of the project we noticed that we were handling similar constructs over and over again. But as we wanted to keep the factories creating the elements decouples we were not able to reuse code. The new concept of Reducer
solves this issue. Reducers are post creation strategies that are executed after the factory created an element. Attributes are a good example of extra data that can be added to any kind of code element, the creation of attributes is always the same. Each factory can have a number of reducers and they can be defined per factory.
Removed deprecation
In php 8.2 dynamic properties were deprecated as this project was using dynamic properties to add extra information to the phpparser nodes we needed to change that functionality. The foundation for this change including a forward compatibility option were added in v5.3 and with this new release the deprecation is removed. From now on FQSEN
of nodes is only available as a node attribute. If your code contains custom factories replace the the usage of $object->fqsen
with $object->getAttribute('fqsen')
phpparser v5
We switched internally to phpparser v5 to ensure this project will keep working with the latest features in php. For normal usecases there won't be any difference. phpparser is still able to process old code back to php 5. But it is no longer possible to switch the parser version when using this project.
- Add reducers to factories to support attributes by @jaapio in #477
- Upgrade code to php 8.1 by @jaapio in #480
- Move parameter building to reducer by @jaapio in #484
- Allow phpparser v5 by @jaapio in #554
- Upgrade to phpunit 10 by @jaapio in #564
Full Changelog: 5.3.3...6.0.0
5.3.3
5.3.2
What's Changed
- Fix issue with inline defined functions by @jaapio
- Whitelist PHP 8.2 on composer by @sonnysantino in #390
New Contributors
- @sonnysantino made their first contribution in #390
Full Changelog: 5.3.1...5.3.2
5.3.1
5.3.0
Added
- Add support for constants in enums by @hemberger in #253
- Add constants support for traits by @jaapio in #258
- Add php 8.2 build by @jaapio in #259
Fixed
- Remove unused
psr/log
dependency by @jeromegamez in #247 - Update installation example in README.md by @WinterSilence in #249
- Pass missed $priority in ProjectFactory::addStrategy() by @WinterSilence in #251
New Contributors
- @jeromegamez made their first contribution in #247
- @WinterSilence made their first contribution in #249
- @hemberger made their first contribution in #253
Full Changelog: 5.2.0...5.3.0
5.2.0
Fixed
- Error with define if it uses variable in name. #237
Added
- #241 Add start and end file positions to method locations by @LeoVie in #243
- Add expression evaluation for define names. by @jaapio in #245
CI
- Bump phpdocumentor/type-resolver from 1.6.0 to 1.6.1 by @dependabot in #242
- Bump actions/cache from 2.1.7 to 3 by @dependabot in #240
- Migrate phive by @jaapio in #244
New Contributors
Full Changelog: 5.1.1...5.2.0
5.1.1
Fixes
- Detect file-level docblocks when the file is flowing PSR-12. by @jaapio
CI
- Bump phpdocumentor/type-resolver from 1.5.1 to 1.6.0 by @dependabot in #235
- GH Actions: version update for various predefined actions by @jrfnl in #238
Full Changelog: 5.1.0...5.1.1
5.1.0
Added
- GH Actions: turn on tests against PHP 8.1 & various other tweaks by @jrfnl in #210
- Add support for php 8.1 enums by @jaapio in #218
- Add support for readonly properties by @jaapio in #221
- Add has return by reference for function and methods by @arogachev in #231
- Add end location to all applicable elements by @arogachev in #230
- Add support for meta data on element by @jaapio
Fixed
- PHPUnit: update configuration by @jrfnl in #214
- GH Actions: version update for
ramsey/composer-install
by @jrfnl in #229 - CS update after upstream changes by @jrfnl in #209
New Contributors
- @jrfnl made their first contribution in #209
- @arogachev made their first contribution in #231
- @marcimat made their first contribution in #233
Full Changelog: 5.0.0...5.1.0
v5.0.1
v5.0.0
This version contains a full rewrite of the way we construct elements. To support features like constructor property promotion we had to redesign the way methods are processed, but also allow factories to produce multiple elements. Which was impossible with the original design.
As a library consumer, this change should not affect your code, unless you were overwriting or extending some of the internal factory classes. To prevent issues for users of this library, we started a new version.
Added
- Constructor promoted properties
- php8 union types
- php8 static type
- php8 mixed type support