Skip to content

Support PHP CodeSniffer standards in packages installed outside of the vendor directory #63

@echernyavskiy

Description

@echernyavskiy

Problem/Motivation

The aim of this is to add proper support for PHP CodeSniffer standards in packages installed outside of the vendor directory. One such example is Drupal's Coder module which is most commonly installed into web/sites/all/modules/contributed/coder or web/modules/contributed/coder where the web directory is on the same level as vendor. The issue is that for such packages composer's getInstallPath() returns an install path relative to the project root directory, and such relative paths are not treated properly later in the body of this plugin's updateInstalledPaths().

Expected behaviour

The coding standard's install path is handled properly by this plugin's updateInstalledPaths() so that the coding standard is properly detected.

Actual behaviour

The coding standard's install path is processed in such a way that the value added to PHPCS's installed_paths is a non-existent directory.

Steps to reproduce

Require both dealerdirect/phpcodesniffer-composer-installer and drupal/coder in composer.json, run composer install. drupal/coder will be installed into the configured Drupal modules directory and will not be properly detected by this plugin.

Proposed changes

The suggestion is to ensure all coding standard install paths are absolute before searching for available rule-sets in updateInstalledPaths(). See #64.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions