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

PHPCSStandards / PHP_CodeSniffer / 13381613036 / 4
78%
master: 79%

Build:
Build:
LAST BUILD BRANCH: 4.x
DEFAULT BRANCH: master
Ran 18 Feb 2025 01:58AM UTC
Files 262
Run time 7s
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

18 Feb 2025 01:49AM UTC coverage: 2.21%. Remained the same
13381613036.4

push

github

jrfnl
PEAR/FunctionDeclaration: prevent fixer conflict for unfinished closures/live coding

The `PEAR.Functions.FunctionDeclaration` sniff contained code to protect against a fixer conflict for unfinished closures, however, this code did not work correctly as an unfinished closure will generally also not have a function body, which "undoes" the protection via the scope opener check.

In other words, the fixer conflict still existed and would result in one part of the sniff trying to _add_ a space between the `function` keyword and the open parenthesis, while another part of the sniff would be removing that space again.

```
        => Fixing file: 1/1 violations remaining
        PEAR.Functions.FunctionDeclaration:124 replaced token 11 (T_WHITESPACE on line 7) " (" => "("
        => Fixing file: 1/1 violations remaining [made 1 pass]...
        * fixed 1 violations, starting loop 2 *
        PEAR.Functions.FunctionDeclaration:94 replaced token 10 (T_FUNCTION on line 7) "function" => "function "
        => Fixing file: 1/1 violations remaining [made 2 passes]...
        * fixed 1 violations, starting loop 3 *
        PEAR.Functions.FunctionDeclaration:124 replaced token 11 (T_WHITESPACE on line 7) " (" => "("
        => Fixing file: 1/1 violations remaining [made 3 passes]...
        * fixed 1 violations, starting loop 4 *
        PEAR.Functions.FunctionDeclaration:94 replaced token 10 (T_FUNCTION on line 7) "function" => "function "
        => Fixing file: 1/1 violations remaining [made 4 passes]...
        * fixed 1 violations, starting loop 5 *
```

Fixed now by verifying if the function is named instead. That way we can be sure it's not a closure.

Includes test.

Builds on the previously pulled fix from PR 816.

Related to #152

674 of 30497 relevant lines covered (2.21%)

0.24 hits per line

Source Files on job os-windows-latest-php-7.2-custom-ini-false - 13381613036.4
  • Tree
  • List 262
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13381613036
  • e8abd9fc on github
  • Prev Job for on 4.0 (#13349728482.3)
  • Next Job for on 4.0 (#13382066417.8)
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