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

Ignore deprecation of AnnotationsRegistry #27

Closed
danepowell opened this issue Jul 1, 2019 · 2 comments
Closed

Ignore deprecation of AnnotationsRegistry #27

danepowell opened this issue Jul 1, 2019 · 2 comments

Comments

@danepowell
Copy link
Contributor

danepowell commented Jul 1, 2019

ORCA scans for deprecated function calls by default.

BLT uses ORCA as well as the AnnotationsRegistry from doctrine/annotations. Unfortunately, AnnotationsRegistry was deprecated even though no alternative currently exists (an alternative will come in the next major release). I consider this a bug in the annotations library, but the maintainer hasn't expressed willingness to fix the situation: doctrine/annotations#270

In order to get deprecation tests running again, I think the best solution would be for ORCA to add a phpstan ignoreErrors directive to ignore the following deprecation error until the upstream bug with doctrine/annotations is fixed:
Call to deprecated method registerFile() of class Doctrine\Common\Annotations\AnnotationRegistry.

If there were any way to solve this within BLT without involving ORCA I definitely would, but it looks like the only way phstan can ignore false positives is via global configuration: phpstan/phpstan#786

TravisCarden added a commit to TravisCarden/orca that referenced this issue Jul 3, 2019
@TravisCarden
Copy link
Contributor

TravisCarden commented Jul 3, 2019

Fixed, @danepowell. Thank you. You can patch ORCA while you're waiting for the next release if you like:

diff --git a/.travis.yml b/.travis.yml
index 458e93da..f2e48130 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -65,6 +65,7 @@ before_install:
   - composer config --global repositories.blt path /tmp/blt-project
   # Install ORCA.
   - git clone --branch ${ORCA_VERSION} --depth 1 https://github.com/acquia/orca.git ../orca
+  - curl https://patch-diff.githubusercontent.com/raw/acquia/orca/pull/28.patch | git -C ../orca apply
   - ../orca/bin/travis/before_install.sh

 install:

@danepowell
Copy link
Contributor Author

Worked like a charm, thanks! acquia/blt@d911abf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants