Skip to content

Commit

Permalink
csfixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed May 28, 2016
1 parent ab0ccf7 commit b853f4b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 40 deletions.
70 changes: 34 additions & 36 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,44 @@ RBAC implementation for HiPanel
@copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

return Symfony\CS\Config\Config::create()
return PhpCsFixer\Config::create()
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'-long_array_syntax', /// Arrays should use the long syntax
'-php4_constructor', /// Convert PHP4-style constructors to __construct. Warning! This could change code behavior
'-phpdoc_var_to_type', /// @var should always be written as @type
'-align_double_arrow', /// Align double arrow symbols in consecutive lines
'-unalign_double_arrow', /// Unalign double arrow symbols in consecutive lines
'-align_equals', /// Align equals symbols in consecutive lines
'-unalign_equals', /// Unalign equals symbols in consecutive lines
'-blankline_after_open_tag', /// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline
'-phpdoc_no_empty_return', /// @return void and @return null annotations should be omitted from phpdocs
'-empty_return', /// A return statement wishing to return nothing should be simply "return"
'-return', /// An empty line feed should precede a return statement
'-phpdoc_params', /// All items of the @param, @throws, @return, @var, and @type phpdoc tags must be aligned vertically
'-phpdoc_scalar', /// Scalar types should always be written in the same form. "int", not "integer"; "bool", not "boolean"
'-phpdoc_separation', /// Annotations of a different type are separated by a single blank line
'-phpdoc_to_comment', /// Docblocks should only be used on structural elements
'header_comment', /// Add, replace or remove header comment
'concat_with_spaces', /// Concatenation should be used with at least one whitespace around
'ereg_to_preg', /// Replace deprecated ereg regular expression functions with preg. Warning! This could change code behavior
'multiline_spaces_before_semicolon', /// Multi-line whitespace before closing semicolon are prohibited
'newline_after_open_tag', /// Ensure there is no code on the same line as the PHP open tag
'single_blank_line_before_namespace', /// There should be no blank lines before a namespace declaration
'ordered_use', /// Ordering use statements
'phpdoc_order', /// Annotations in phpdocs should be ordered so that @param come first, then @throws, then @return
'pre_increment', /// Pre incrementation/decrementation should be used if possible
'short_array_syntax', /// PHP arrays should use the PHP 5.4 short-syntax
'strict', /// Comparison should be strict. Warning! This could change code behavior
'strict_param', /// Functions should be used with $strict param. Warning! This could change code behavior
])
->setRiskyAllowed(true)
->setRules(array(
'@PSR2' => true,
'header_comment' => ['header' => $header], /// Add, replace or remove header comment
'long_array_syntax' => false, /// Arrays should use the long syntax
'php4_constructor' => false, /// Convert PHP4-style constructors to __construct. Warning! This could change code behavior
'phpdoc_var_to_type' => false, /// @var should always be written as @type
'align_double_arrow' => false, /// Align double arrow symbols in consecutive lines
'unalign_double_arrow' => false, /// Unalign double arrow symbols in consecutive lines
'align_equals' => false, /// Align equals symbols in consecutive lines
'unalign_equals' => false, /// Unalign equals symbols in consecutive lines
'phpdoc_no_empty_return' => false, /// @return void and @return null annotations should be omitted from phpdocs
'empty_return' => false, /// A return statement wishing to return nothing should be simply "return"
'return' => false, /// An empty line feed should precede a return statement
'phpdoc_params' => false, /// All items of the @param, @throws, @return, @var, and @type phpdoc tags must be aligned vertically
'phpdoc_scalar' => false, /// Scalar types should always be written in the same form. "int", not "integer"; "bool", not "boolean"
'phpdoc_separation' => false, /// Annotations of a different type are separated by a single blank line
'phpdoc_to_comment' => false, /// Docblocks should only be used on structural elements
'method_argument_space' => false, /// In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma
'concat_with_spaces' => true, /// Concatenation should be used with at least one whitespace around
'ereg_to_preg' => true, /// Replace deprecated ereg regular expression functions with preg. Warning! This could change code behavior
'blank_line_after_opening_tag' => true, /// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline
'single_blank_line_before_namespace' => true, /// There should be no blank lines before a namespace declaration
'ordered_imports' => true, /// Ordering use statements
'phpdoc_order' => true, /// Annotations in phpdocs should be ordered so that @param come first, then @throws, then @return
'pre_increment' => true, /// Pre incrementation/decrementation should be used if possible
'short_array_syntax' => true, /// PHP arrays should use the PHP 5.4 short-syntax
'strict_comparison' => true, /// Comparison should be strict. (Risky fixer!)
'strict_param' => true, /// Functions should be used with $strict param. Warning! This could change code behavior
'no_multiline_whitespace_before_semicolons' => true, /// Multi-line whitespace before closing semicolon are prohibited
))
->finder(
Symfony\CS\Finder\DefaultFinder::create()
PhpCsFixer\Finder::create()
->in(__DIR__)
->notPath('vendor')
->notPath('runtime')
->notPath('web/assets')
->notPath('tests/unit/UnitTester.php')
)
)
;
9 changes: 9 additions & 0 deletions src/config/hidev.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* RBAC implementation for HiPanel
*
* @link https://github.com/hiqdev/hipanel-rbac
* @package hipanel-rbac
* @license BSD-3-Clause
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
*/

return [
'components' => [
'config' => [
Expand Down
8 changes: 4 additions & 4 deletions src/console/RbacController.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/*
* HiPanel core package
* RBAC implementation for HiPanel
*
* @link https://hipanel.com/
* @package hipanel-core
* @link https://github.com/hiqdev/hipanel-rbac
* @package hipanel-rbac
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
* @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
*/

namespace hipanel\rbac\console;
Expand Down

0 comments on commit b853f4b

Please sign in to comment.