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

PHPCSStandards / PHP_CodeSniffer / 8532137691
78%
master: 78%

Build:
Build:
LAST BUILD BRANCH: DocXMLPEARClassesClassDeclaration
DEFAULT BRANCH: master
Ran 03 Apr 2024 02:05AM CUT
Jobs 3
Files 259
Run time 4min
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 CUT coverage: 72.352% (+0.02%) from 72.328%
8532137691

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.

6 of 7 new or added lines in 1 file covered. (85.71%)

4 existing lines in 3 files now uncovered.

17358 of 23991 relevant lines covered (72.35%)

55.3 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
69.35
0.1% src/Files/File.php

Uncovered Existing Lines

Lines Coverage ∆ File
1
98.68
-0.05% src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php
1
95.45
-4.55% src/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php
2
98.79
0.01% src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
Jobs
ID Job ID Ran Files Coverage
1 php-8.3-custom-ini-false - 8532137691.1 03 Apr 2024 02:05AM CUT 259
70.82
GitHub Action Run
2 php-8.1-custom-ini-true - 8532137691.2 03 Apr 2024 02:05AM CUT 259
70.85
GitHub Action Run
3 php-7.2-custom-ini-false - 8532137691.3 03 Apr 2024 02:06AM CUT 259
68.53
GitHub Action Run
Source Files on build 8532137691
  • Tree
  • List 259
  • Changed 7
  • Source Changed 4
  • Coverage Changed 6
Loading...
Coverage∆FileLinesRelevantCoveredMissedHits/Line
  • Back to Repo
  • Github Actions Build #8532137691
  • ea478181 on github
  • Prev Build on 4.0 (#8499857049)
  • Next Build on 4.0 (#8582975589)
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

© 2025 Coveralls, Inc