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

slevomat / coding-standard / 2158
85%

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

pending completion
2158

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

Jobs
ID Job ID Ran Files Coverage
23 2158.23 (DEPENDENCIES=highest) 05 Apr 2020 06:05AM UTC 0
100.0
Travis Job 2158.23
Source Files on build 2158
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2158
  • c21945c3 on github
  • Prev Build on master (#2152)
  • Next Build on master (#2159)
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