cursorstartups/php-styles

This package is abandoned and no longer maintained. No replacement package was suggested.

Cursor startups shared PHP style rules for PHP-CS-Fixer

v1.12.0 2022-04-02 07:13 UTC

README

Packagist Version Packagist Downloads GitHub issues GitHub stars GitHub forks GitHub license

About

PHP-CS-Fixer is an open-source tool that can enforce, and detect violations of, PHP coding styles. With predefined rules, it allows you to have a strict coding style.

This repo is intended for use on all Cursor Startups Project.

Installation

Require the package in your laravel or php project.

composer require cursorstartups/php-styles --dev

If you are working on a laravel project copy .php-cs-fixer.dist.php to root directory

cp vendor/cursorstartups/php-styles/.laravel-php-cs-fixer.dist.php .php-cs-fixer.dist.php

Usage

To Fix code, run

./vendor/bin/php-cs-fixer fix

To make is easier, you can add a shortcut command on your composer.json as follows

   "scripts":
        "format": [
            "./vendor/bin/php-cs-fixer fix"
        ],
   }

After that you can run the following from terminal

composer format

Note: The above command will create .php-cs-fixer.cache. Remember to add this file to your .gitignore

Credit