Skip to content
PHP coding standard used in LMC projects
Branch: master
Clone or download
OndraM Merge pull request #31 from OndraM/feature/phpstan-upgrade
Upgrade to latest phpstan with extension-installer support
Latest commit f487784 May 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Fixer
tests/Fixer
.coveralls.yml Setup codestyle check for codestyle check. Quis custodiet ipsos custo… May 14, 2018
.editorconfig Require ECS Mar 16, 2018
.gitignore
.travis.yml Upgrade to latest phpstan with extension-installer support May 20, 2019
CHANGELOG.md
LICENCE.md
README.md
composer.json Upgrade to latest phpstan with extension-installer support May 20, 2019
easy-coding-standard.yaml
phpstan.neon
phpunit.xml.dist Add SpecifyArgSeparatorFixer to make sure arg_separator is always def… May 14, 2018
yaml-sort-checker.yml

README.md

LMC Coding Standard for PHP

Latest Stable Version

PHP coding standard used in LMC projects.

Standard is based on PSR-2 and adds various checks to make sure the code is readable, does follow the same conventions and does not contain common mistakes.

We use EasyCodingStandard to define and execute checks created for both PHP-CS-Fixer and PHP_CodeSniffer.

Installation

composer require --dev lmc/coding-standard

Usage

  1. Create easy-coding-standard.yaml file in root directory of your project and import the LMC code-style rules:
imports:
    - { resource: '%vendor_dir%/lmc/coding-standard/easy-coding-standard.yaml' }
  1. Run the check command (for src/ and tests/ directories):
vendor/bin/ecs check src/ tests/
  1. Optionally we recommend adding this to scripts section of your composer.json:
    "scripts": {
        "analyze": [
            "vendor/bin/ecs check src/ tests/ --ansi",
            "[... other scripts, like PHPStan etc.]"
        ]
    }

Exclude (skip) some checks or files

You can configure EasyCodingStandard via parameters section of your easy-coding-standard.yaml to:

  • exclude a specific file from all checks (via exclude_files)
  • disable specific check completely or for some file(s) or directories (via skip)

IDE integration

For integration with PHPStorm etc. follow instructions in EasyCodingStandard README.

Changelog

For latest changes see CHANGELOG.md file. We follow Semantic Versioning.

License

This library is open source software licensed under the MIT license.

You can’t perform that action at this time.