45press/phpcs

PHPCS base ruleset for 45PRESS

Maintainers

Details

github.com/45PRESS/phpcs

Source

Issues

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpcodesniffer-standard

dev-master 2019-06-05 09:28 UTC

This package is auto-updated.

Last update: 2024-11-05 21:55:43 UTC


README

Installation

Install the library via Composer:

composer require --dev 45press/phpcs:dev-master

Usage

Lint your PHP files with the following command:

./vendor/bin/phpcs .

Edit the composer.json file by adding the following:

  "scripts": {
    "lint": [
      "phpcs ."
    ],
  }

Then lint with...

composer run lint

Continuous Integration

Library loads the 45PRESS-Standard ruleset, and checks for syntax errors for PHP 7.1 or higher.

To override the default PHP version check, set the --runtime-set testVersion 7.1- configuration option. Example for PHP version 7.2 and above:

./vendor/bin/phpcs --runtime-set testVersion 7.2-

Note that you can only overrule PHP version check from the command-line.

IDE

IDE integrations of PHPCS can fail to register the 45PRESS-Standard ruleset. If this happens, place .phpcs.xml.dist at your project root:

<?xml version="1.0"?>
<ruleset name="Project PHPCS">
	<rule ref="45PRESS-Standard" />
</ruleset>