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

slevomat / coding-standard / 2158 / 23
85%
master: 85%

Build:
DEFAULT BRANCH: master
Ran 05 Apr 2020 06:06AM UTC
Files 176
Run time 10s
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

05 Apr 2020 05:52AM UTC coverage: 100.0%. Remained the same
DEPENDENCIES=highest

push

travis-ci

kukulich
Bug fix: select sniffs would not run

Ok, complex one to explain again, but the short of it is that PHPCS does the file name to sniff name translation when autoloading sniffs.

Now for sniffs which extend other sniffs and/or abstracts, when the first sniff which extends such an abstract is requested, the PHPCS autoloader would kick in and then the Composer autoloader would also kick in the `extends`, with the end result being that the PHPCS autoloader would return the name of the _abstract_ class to the originating call, which in effect meant that the sniff could never be referenced/included by name as PHPCS would not know which file went with that name.

As the PHPCS autoloader can handle any loading any files within the "standard" directory, loading those files should be left to the PHPCS autoloader so it can do the file to sniffname translation correctly.

Removing the `autoload` directive for `--no-dev` installs fixes the issue.

To reproduce the issue:
* Clone the SlevomatCS repo at `master`
* Run `composer install --no-dev` in the root of the SlevomatCS clone.
* Clone PHPCS
* Register the `PHP_CodeSniffer/bin` directory to the system path.
* Run `phpcs --config-set installed_paths path/to/slevomatCS_clone
* Go to a directory with some files which can be used for testing.
* Run `. --standard=slevomatcodingstandard --extensions=php --ignore=/vendor/* --sniffs=SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants`

The response will be:
```
ERROR: No sniffs were registered

Run "phpcs --help" for usage information
```

* Now, switch to this PR branch.
* Run `composer install --no-dev` in the root of the SlevomatCS clone.
* Go to a directory with some files which can be used for testing.
* Run `. --standard=slevomatcodingstandard --extensions=php --ignore=/vendor/* --sniffs=SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants`

PHPCS will run as expected.

9204 of 9204 relevant lines covered (100.0%)

9.55 hits per line

Source Files on job 2158.23 (DEPENDENCIES=highest)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1870
  • Travis Job 2158.23
  • c21945c3 on github
  • Prev Job for DEPENDENCIES=highest on master (#2152.23)
  • Next Job for DEPENDENCIES=highest on master (#2159.23)
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