Skip to content

Coding Labs standard PHP styling. Subject to change - use at your own risk!

License

Notifications You must be signed in to change notification settings

codinglabsau/php-styles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Styles

A PHP-CS-Fixer ruleset to share across projects, inspired by this Tim MacDonald article.

Installation

Via Composer

$ composer require codinglabsau/php-styles

Usage

Create .php-cs-fixer.dist.php in the root of the project:

<?php

$finder = PhpCsFixer\Finder::create()
    ->in([
        __DIR__.'/app',
        __DIR__.'/config',
        __DIR__.'/database',
        __DIR__.'/routes',
        __DIR__.'/tests',
    ]);

return CodingLabs\styles($finder);

Note the second argument for styles is an array of rules to override the defaults.

Do a dry run like this (handy for CI): ./vendor/bin/php-cs-fixer fix --dry-run

And do a proper fix like this: ./vendor/bin/php-cs-fixer fix

Contributing

This package is opinionated to our preferred code style at Coding Labs and subject to change, so use with caution!

Credits

License

MIT. Please see the license file for more information.

About Coding Labs

Coding Labs is a web app development agency based on the Gold Coast, Australia. See our open source projects on our website.

About

Coding Labs standard PHP styling. Subject to change - use at your own risk!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages