Skip to content

Commit

Permalink
Fixed with php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Dyan committed Aug 28, 2015
1 parent 0258447 commit be24365
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->files()
->name('*.php')
->in('src');

return Symfony\CS\Config\Config::create()
->level(\Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers(array(
// All items of the @param, @throws, @return, @var, and @type phpdoc
// tags must be aligned vertically.
'phpdoc_params',
// Convert double quotes to single quotes for simple strings.
'single_quote',
// Group and seperate @phpdocs with empty lines.
'phpdoc_separation',
// An empty line feed should precede a return statement.
'return',
// Remove trailing whitespace at the end of blank lines.
'whitespacy_lines',
// Removes extra empty lines.
'extra_empty_lines',
// Unused use statements must be removed.
'unused_use',
// PHP code MUST use only UTF-8 without BOM (remove BOM).
'encoding',
// A file must always end with a single empty line feed.
'eof_ending',
// All PHP files must use the Unix LF (linefeed) line ending.
'linefeed',
// Remove trailing whitespace at the end of non-blank lines.
'trailing_spaces',
))
->finder($finder);
3 changes: 2 additions & 1 deletion src/Rule/ReplaceRegexp.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class ReplaceRegexp extends AbstractRule
{
/**
* PHP Constants that says what's happened with the PregRegexp
* @var array
*
* @var array
*/
protected $pregErrs = array(
\PREG_INTERNAL_ERROR => 'Internal Error',
Expand Down
3 changes: 0 additions & 3 deletions src/Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ class Transform
*/
protected $currentRules = array();


/**
* Doesn't allow the class to be instanciated
*/
protected function __construct()
{

}

/**
Expand Down Expand Up @@ -149,7 +147,6 @@ public function __call($ruleName, $arguments)
*/
public function transform($input)
{

$validTypes = array('boolean', 'integer', 'double', 'string');
$inputType = gettype($input);
if (!in_array($inputType, $validTypes)) {
Expand Down

0 comments on commit be24365

Please sign in to comment.