Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 957 Bytes

code-style.md

File metadata and controls

33 lines (25 loc) · 957 Bytes

Extensions - Code Style

Spiral framework ships with an extension intended to unify the coding style across its components and your applications. The extension code style is based on a strict PSR-12 with no exceptions.

The extension repository: https://github.com/spiral/code-style

The actual formatting and style-checking is based on:

Installation

To install the extension:

$ composer require --dev spiral/code-style

Check the code

To check code-style compliance:

# vendor/bin/spiral-cs check <dir1> <dir2> <file1>....
$ vendor/bin/spiral-cs check src tests

Automatically fix the code style

To automatically fix code-style:

# vendor/bin/spiral-cs fix <dir1> <dir2> <file1>....
$ vendor/bin/spiral-cs fix src tests

Note, the extensions will force CL endings.