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

phan failing on PHP 7.2 and 7.3 #35697

Closed
3 tasks
phil-davis opened this issue Jun 28, 2019 · 7 comments
Closed
3 tasks

phan failing on PHP 7.2 and 7.3 #35697

phil-davis opened this issue Jun 28, 2019 · 7 comments
Assignees

Comments

@phil-davis
Copy link
Contributor

PHP patch releases were applied today to the docker images used in drone CI.
7.1.30
7.2.19
7.3.6

after that, phan started to fail on PHP 7.2 and 7.3 - e.g. https://drone.owncloud.com/owncloud/core/18990/98

ReflectionException: Method Closure::__invoke() does not exist in /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Language/Element/FunctionFactory.php:96
Stack trace:
#0 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Language/Element/FunctionFactory.php(96): ReflectionMethod->__construct('Closure', '__invoke')
#1 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Language/Element/Clazz.php(311): Phan\Language\Element\FunctionFactory::methodListFromReflectionClassAndMethod(Object(Phan\Language\Context), Object(ReflectionClass), Object(ReflectionMethod))
#2 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/CodeBase.php(811): Phan\Language\Element\Clazz::fromReflectionClass(Object(Phan\CodeBase), Object(ReflectionClass))
#3 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/CodeBase.php(800): Phan\CodeBase->loadPHPInternalClassWithFQSEN(Object(Phan\Language\FQSEN\FullyQualifiedClassName), Object(ReflectionClass))
#4 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/CodeBase.php(788): Phan\CodeBase->lazyLoadPHPInternalClassWithFQSEN(Object(Phan\Language\FQSEN\FullyQualifiedClassName))
#5 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Analysis/PropertyTypesAnalyzer.php(64): Phan\CodeBase->hasClassWithFQSEN(Object(Phan\Language\FQSEN\FullyQualifiedClassName))
#6 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Language/Element/Clazz.php(2575): Phan\Analysis\PropertyTypesAnalyzer::analyzePropertyTypes(Object(Phan\CodeBase), Object(Phan\Language\Element\Clazz))
#7 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Analysis.php(403): Phan\Language\Element\Clazz->analyze(Object(Phan\CodeBase))
#8 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Phan.php(275): Phan\Analysis::analyzeClasses(Object(Phan\CodeBase), NULL)
#9 /drone/src/vendor-bin/phan/vendor/phan/phan/src/Phan/Phan.php(225): Phan\Phan::finishAnalyzingRemainingStatements(Object(Phan\CodeBase), NULL, Array, Array)
#10 /drone/src/vendor-bin/phan/vendor/phan/phan/src/phan.php(41): Phan\Phan::analyzeFileList(Object(Phan\CodeBase), Object(Closure))
#11 /drone/src/vendor-bin/phan/vendor/phan/phan/phan(2): require_once('/drone/src/vend...')
#12 {main}

make: *** [test-php-phan] Error 1
Makefile:222: recipe for target 'test-php-phan' failed 

For now, PR #35693 disables the phan step for PHP 7.2 and 7.3 - it still runs and passes on PHP 7.1

  • sort out what is wrong
  • find a suitable version of phan
  • enable it again on 7.2 and 7.3
@phil-davis
Copy link
Contributor Author

@micbar @patrickjahns this needs to be sorted out some time. You can decide the priority.

Note: the version of phan can be increased and the error goes away. But the newer version(s) of phan report lots more code "issues". So work would be needed to sort out how to setup phan correctly, or correct the code, or suppress messages as appropriate.

@patrickjahns
Copy link
Contributor

A shot was to get the dependencies resolved to the proper php version #35704 - didn't have the desired effect :(

@patrickjahns
Copy link
Contributor

Suggestion:

  • we bump phan to a later version, but we just ignore the issues found on top of current issues?

@phil-davis
Copy link
Contributor Author

Agree - any issue that is not "obvious" to fix, we can suppress it.

@micbar
Copy link
Contributor

micbar commented Jul 19, 2019

@patrickjahns @phil-davis Next steps?

@phil-davis
Copy link
Contributor Author

phil-davis commented Jul 20, 2019

@micbar @patrickjahns I am waiting for reviews of
#35817
#35818

IMO those are ready. Unless somebody responds to the items that are marked "ready for review" in the sprint, there is nothing that I can do.

@phil-davis
Copy link
Contributor Author

See #36092 for follow-up issue

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