2017 © Pedro Peláez
 

library imbo-phpcs-standard

image

imbo/imbo-phpcs-standard

  • Tuesday, May 1, 2018
  • by cogocogo
  • Repository
  • 4 Watchers
  • 2 Stars
  • 899 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Imbo Coding Standard

CI workflow, (*1)

This is the PHP coding standard for the Imbo project and all related tools. The ruleset is enforced using the PHP Coding Standards Fixer tool., (*2)

How to setup

First, add this package and php-cs-fixer as development dependencies:, (*3)

composer require --dev imbo/imbo-coding-standard ^2.0 friendsofphp/php-cs-fixer

then, create a configuration file named .php-cs-fixer.php local to your repository that includes the following:, (*4)

<?php declare(strict_types=1);
require 'vendor/autoload.php';

$finder = (new PhpCsFixer\Finder())
    ->in(__DIR__)
    ->append([__FILE__]);

return (new Imbo\CodingStandard\Config())
    ->setFinder($finder);

Adjust the paths if necessary. Now you can run the following command to check the coding standard in your project:, (*5)

vendor/bin/php-cs-fixer check --diff

Add step in the GitHub workflow

All Imbo-related projects use GitHub workflows, and checking the coding standard should be a part of that workflow:, (*6)

name: CI workflow
on: push
jobs:
  php-cs-fixer:
    runs-on: ubuntu-latest
    name: Check coding standard
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2

      - name: Install dependencies
        run: composer install

      - name: Check coding standard
        run: vendor/bin/php-cs-fixer check --diff

Add scripts for Composer

All Imbo-related projects use Composer, and checking / fixing coding standard violations should be done using Composer scripts in composer.json:, (*7)

{
  "scripts": {
    "cs": "vendor/bin/php-cs-fixer check --diff",
    "cs:fix": "vendor/bin/php-cs-fixer fix --diff"
  }
}

The Versions

01/05 2018

v1.2.0

1.2.0.0

  Sources   Download

01/05 2018

v1.3.0

1.3.0.0

  Sources   Download

01/05 2018

v1.3.1

1.3.1.0

  Sources   Download

01/05 2018

v1.0.0

1.0.0.0

  Sources   Download

01/05 2018

v1.1.0

1.1.0.0

  Sources   Download

01/05 2018

v1.1.1

1.1.1.0

  Sources   Download

16/09 2016

dev-master

9999999-dev http://imbo.io/

Imbo PHP_CodeSniffer coding standard

  Sources   Download

MIT

image storage image transformation image metadata

16/09 2016

dev-develop

dev-develop http://imbo.io/

Imbo PHP_CodeSniffer coding standard

  Sources   Download

MIT

image storage image transformation image metadata

16/09 2016

v1.4.0

1.4.0.0 http://imbo.io/

Imbo PHP_CodeSniffer coding standard

  Sources   Download

MIT

image storage image transformation image metadata