• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PHPCSStandards / PHP_CodeSniffer / 8532137691 / 2
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: catch-per-3.0
DEFAULT BRANCH: master
Ran 03 Apr 2024 02:06AM UTC
Files 259
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Apr 2024 02:02AM UTC coverage: 70.848% (+0.003%) from 70.845%
8532137691.2

push

github

jrfnl
File::getMethodProperties(): skip over closure use statements

This PR improves performance of the `File::getMethodProperties()` method and prevents incorrect return type information for closures `use` clauses containing invalid variable imports in the `use` clause (defensive coding).

Closure `use` statements can only import plain variables, not properties or other more complex variables.

As things were, when such "illegal" variables were imported in a closure `use`, the information for the return type could get mangled.
While this would be a parse error, for the purposes of static analysis, the `File::getMethodProperties()` method should still handle this correctly.

This commit updates the `File::getMethodProperties()` method to always skip over the complete `use` clause, which prevents the issue and improves performance as the same time (less token walking).

Includes unit tests.

16903 of 23858 relevant lines covered (70.85%)

18.45 hits per line

Source Files on job php-8.1-custom-ini-true - 8532137691.2
  • Tree
  • List 259
  • Changed 5
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8532137691
  • ea478181 on github
  • Prev Job for on 4.0 (#8499857049.3)
  • Next Job for on 4.0 (#8582975589.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc