2017 © Pedro Peláez
 

library php-code-formatter

A code formatter for php code

image

gossi/php-code-formatter

A code formatter for php code

  • Saturday, July 1, 2017
  • by gossi
  • Repository
  • 6 Watchers
  • 23 Stars
  • 488 Installations
  • PHP
  • 0 Dependents
  • 2 Suggesters
  • 4 Forks
  • 20 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

PHP Code Formatter

License Latest Stable Version Total Downloads
Build Status Scrutinizer Code Quality Code Coverage, (*1)

A library for formatting php code., (*2)

Features

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

-> Wishlist, (*3)

Getting started

Installation

Via composer:, (*4)

composer require gossi/php-code-formatter

From Code

This simple code snippet is all you need:, (*5)

use gossi\formatter\Formatter;

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

From CLI

A bare cli version is available:, (*6)

vendor/bin/phormat path/to/file.php

will output the formatted source code to stdout, (*7)

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., (*8)

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

The Versions

01/07 2017