From 40aa2bfadac08458408733ba4b8e8bd97eca8b6f Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Thu, 13 Jul 2017 17:43:37 +0200 Subject: [PATCH 1/2] Only run builds on 2.0 and master branches --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6ba20b6..9767281 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,11 @@ after_script: sudo: false +branches: + only: + - 2.0 + - master + notifications: email: - n.widart@gmail.com From 1bfa69fa6a1e0592a9b933c45f3035f70678f098 Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Thu, 13 Jul 2017 19:31:46 +0200 Subject: [PATCH 2/2] CS: PSR1/2 --- .php_cs => .php_cs.dist | 55 ++++++++++++++++++------------------- Http/backendRoutes.php | 1 - Sidebar/SidebarExtender.php | 1 - 3 files changed, 27 insertions(+), 30 deletions(-) rename .php_cs => .php_cs.dist (54%) diff --git a/.php_cs b/.php_cs.dist similarity index 54% rename from .php_cs rename to .php_cs.dist index 60ba9d7..7efccad 100644 --- a/.php_cs +++ b/.php_cs.dist @@ -1,48 +1,47 @@ exclude('Modules') - ->exclude('vendor') +$finder = PhpCsFixer\Finder::create() ->in(__DIR__) + ->exclude([ + 'Modules', + 'vendor', + ]) + ->notPath('server.php') ; -return Symfony\CS\Config\Config::create() - ->setUsingCache(true) - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers(array( +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRules([ + '@PSR2' => true, // Concatenation should be used with at least one whitespace around. - 'concat_with_spaces', + 'concat_space' => ['spacing' => 'one'], // Unused use statements must be removed. - 'ordered_use', + 'ordered_imports' => true, // Removes extra empty lines. - 'extra_empty_lines', - // Removes line breaks between use statements. - 'remove_lines_between_uses', + 'no_extra_consecutive_blank_lines' => true, // An empty line feed should precede a return statement. - 'return', + 'blank_line_before_return' => true, // Unused use statements must be removed. - 'unused_use', + 'no_unused_imports' => true, // Remove trailing whitespace at the end of blank lines. - 'whitespacy_lines', + 'no_whitespace_in_blank_line' => true, // There MUST be one blank line after the namespace declaration. - 'line_after_namespace', + 'blank_line_after_namespace' => true, // There should be exactly one blank line before a namespace declaration. - 'single_blank_line_before_namespace', + 'single_blank_line_before_namespace' => true, // Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block. - 'single_line_after_imports', + 'single_line_after_imports' => true, // Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline. - 'blankline_after_open_tag', + 'blank_line_after_opening_tag' => true, // Remove duplicated semicolons. - 'duplicate_semicolon', + 'no_empty_statement' => true, // PHP multi-line arrays should have a trailing comma. - 'multiline_array_trailing_comma', + 'trailing_comma_in_multiline_array' => true, // There should be no empty lines after class opening brace. - 'no_blank_lines_after_class_opening', + 'no_blank_lines_after_class_opening' => true, // There should not be blank lines between docblock and the documented element. - 'no_empty_lines_after_phpdocs', + 'no_blank_lines_after_phpdoc' => true, // Phpdocs should start and end with content, excluding the very first and last line of the docblocks. - 'phpdoc_trim', - // Removes line breaks between use statements. - 'remove_lines_between_uses', - )) - ->finder($finder); + 'phpdoc_trim' => true, + ]) +; diff --git a/Http/backendRoutes.php b/Http/backendRoutes.php index 3b39338..3e23f0d 100644 --- a/Http/backendRoutes.php +++ b/Http/backendRoutes.php @@ -107,5 +107,4 @@ 'uses' => 'TagController@destroy', 'middleware' => 'can:blog.tags.destroy', ]); - }); diff --git a/Sidebar/SidebarExtender.php b/Sidebar/SidebarExtender.php index d96acce..ae351c6 100644 --- a/Sidebar/SidebarExtender.php +++ b/Sidebar/SidebarExtender.php @@ -33,7 +33,6 @@ public function extendWith(Menu $menu) { $menu->group(trans('core::sidebar.content'), function (Group $group) { $group->item(trans('blog::blog.title'), function (Item $item) { - $item->icon('fa fa-copy'); $item->weight(0);