Skip to content

Repository files navigation

mCODE

📺 PHP quality assurance for ModernTV projects.

🕹 f3l1x.io | 💻 f3l1x | 🐦 @xf3l1x


Usage

To install latest version of mcode/mcode use Composer.

composer require mcode/mcode

Documentation

Codesniffer

  1. Install this package.
  2. Create ruleset.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<ruleset>
  <rule ref="./vendor/mcode/mcode/src/codesniffer.xml"/>
</ruleset>
  1. Run codesniffer.
vendor/bin/phpcs --cache=var/codesniffer.dat --standard=ruleset.xml app

Phpstan

  1. Install this package.

  2. Create phpstan.neon file.

    includes:
    	- vendor/mcode/mcode/src/phpstan.neon
    	- phpstan-baseline.neon
    
    parameters:
    	level: 9
    	phpVersion: 80200
    
    	tmpDir: %currentWorkingDirectory%/temp/phpstan
    
    	fileExtensions:
    		- php
    		- phpt
    
    	paths:
    		- app

Development

The shipped ruleset is covered by tests. Fixtures live in tests/Sniffs/<Family>/, where Good.php must be reported clean and Bad.php must produce exactly the report stored in its snapshot. tests/sniffs.snapshot.json pins the list of registered sniffs, so an upgrade of codesniffer or slevomat cannot silently add or drop a rule.

make tests      # run the test suite
make snapshots  # regenerate snapshots after an intentional ruleset change
make qa         # lint, phpstan and codesniffer

To cover a new rule, add a fixture (or extend an existing one), run make snapshots and review the snapshot diff.

This package is currently maintained by these authors.

About

📺 PHP quality assurance for ModernTV projects.

Resources

Stars

1 star

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages