gossi/php-code-formatter

A code formatter for php code


Keywords
php, formatter, beautifier
License
MIT

Documentation

PHP Code Formatter

Build Status Scrutinizer Code Quality Code Coverage

A library for formatting php code.

Features

  • Whitespace
  • New lines
  • Indentation (on curly braces only)
  • Blanks (partial support)

-> Wishlist

Getting started

Installation

Via composer:

{
    "require": {
        "gossi/php-code-formatter": "dev-master"
    }
}

From Code

This simple code snippet is all you need:

use gossi\formatter\Formatter;

$formatter = new Formatter();
$beautifulCode = $formatter->format($uglyCode);

From CLI

Not yet, see #2

Development

php code formatter is not yet finished (see Wishlist). Please help the development, by picking one of the open issues or implement your own rules. See the wiki on creating your own rules.

Psr-2? Spaces suck, deal with it :p Once Version 1.0 is reached, a psr-2 profile will be shipped.