From be2436509a5a0b8d7200670362c26a639f7ba2ff Mon Sep 17 00:00:00 2001 From: Emmanuel Dyan Date: Fri, 28 Aug 2015 14:10:14 +0200 Subject: [PATCH] Fixed with php-cs-fixer --- .php_cs | 35 +++++++++++++++++++++++++++++++++++ src/Rule/ReplaceRegexp.php | 3 ++- src/Transform.php | 3 --- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .php_cs diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..05d240a --- /dev/null +++ b/.php_cs @@ -0,0 +1,35 @@ +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); diff --git a/src/Rule/ReplaceRegexp.php b/src/Rule/ReplaceRegexp.php index 52a9ec3..6c66c28 100644 --- a/src/Rule/ReplaceRegexp.php +++ b/src/Rule/ReplaceRegexp.php @@ -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', diff --git a/src/Transform.php b/src/Transform.php index cb277c5..42c1096 100644 --- a/src/Transform.php +++ b/src/Transform.php @@ -44,13 +44,11 @@ class Transform */ protected $currentRules = array(); - /** * Doesn't allow the class to be instanciated */ protected function __construct() { - } /** @@ -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)) {