Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC BREAK: removed Scanner component, removed FileReflection, removed NameInformation and made DocBlockScanner @internal #58

Merged
merged 3 commits into from
Dec 9, 2020

Conversation

Ocramius
Copy link
Member

@Ocramius Ocramius commented Nov 30, 2020

The scanners were full of incomplete, untested and generally experimental code that would simply
crash when presented with something like PHP 8 code.

In addition to that, they were extremely unmaintainable due to the code being written for PHP 5,
and never being touched afterwards (too complex).

In order to slim down things and keep maintenance cost low, the complete Laminas\Code\Scanner
component has been trashed, with the exception of Laminas\Code\Scanner\DocBlockScanner, which
is still used in in some reflection internals.

It is advised for end-users to move to more modern tooling, such as roave/better-reflection
which provides a safer (and well tested) API to scan source directories and extract reflection
information without loading any potentially dangerous PHP files.

The following components have been removed from the public API:

  • Laminas\Code\Scanner\*
  • Laminas\Code\NameInformation (unused in this package)
  • Laminas\Code\Reflection\FileReflection (use roave/better-reflection instead)
  • Laminas\Code\Generic\Prototype\*, which contains utilities to define custom docblock types:
    please consider using something like https://github.com/phpDocumentor/ReflectionDocBlock instead.
Q A
Documentation no
Bugfix yes
BC Break yes
New Feature no
RFC yes
QA no

TODOs:

@Ocramius Ocramius added this to the 4.0.0 milestone Nov 30, 2020
@Ocramius Ocramius self-assigned this Nov 30, 2020
@Ocramius
Copy link
Member Author

Also here: BEFORE merging, we need Github Actions to actually run on the codebase.

I went way overtime with this, but my aim is to do that Wednesday after work.

@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius mentioned this pull request Nov 30, 2020
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius mentioned this pull request Nov 30, 2020
3 tasks
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
3 tasks
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
@Ocramius Ocramius linked an issue Nov 30, 2020 that may be closed by this pull request
Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

I've checked the documentation and README.md file, and there are no mentions at all of scanning, so I think with a CHANGELOG.md entry, you're good to go.

…ved `NameInformation` and made `DocBlockScanner` `@internal`

The scanners were full of incomplete, untested and generally experimental code that would simply
crash when presented with something like PHP 8 code.

In addition to that, they were extremely unmaintainable due to the code being written for PHP 5,
and never being touched afterwards (too complex).

In order to slim down things and keep maintenance cost low, the complete `Laminas\Code\Scanner`
component has been trashed, with the exception of `Laminas\Code\Scanner\DocBlockScanner`, which
is still used in in some reflection internals.

It is advised for end-users to move to more modern tooling, such as [`roave/better-reflection`](https://github.com/Roave/BetterReflection)
which provides a safer (and well tested) API to scan source directories and extract reflection
information without loading any potentially dangerous PHP files.

The following components have been removed from the public API:

 * `Laminas\Code\Scanner\*`
 * `Laminas\Code\NameInformation` (unused in this package)
 * `Laminas\Code\Reflection\FileReflection` (use `roave/better-reflection` instead)
 * `Laminas\Code\Generic\Prototype\*`, which contains utilities to define custom docblock types:
   please consider using something like https://github.com/phpDocumentor/ReflectionDocBlock instead.

Signed-off-by: Marco Pivetta <[email protected]>
…l` addition or deletions

Signed-Off-By: Marco Pivetta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment