From 4c95ee4d5822dc9b55aa4b9db5dbad4d46f94df9 Mon Sep 17 00:00:00 2001 From: Andreas Oesterreicher Date: Sun, 2 Jul 2017 18:37:55 +0200 Subject: [PATCH] Fixed Codesniffer test files according to FHComplete Style --- .../tests/files/FHComplete/throws_pass.php | 50 +++++++++---------- .../files/control_structure_brackets_pass.php | 16 ++++-- .../tests/files/control_structure_dowhile.php | 3 +- .../tests/files/control_structure_elseif.php | 7 ++- .../files/control_structure_indentation.php | 5 +- .../tests/files/control_structure_nospace.php | 3 +- .../tests/files/docblock_align_fail.php | 25 +++++----- .../tests/files/docblock_align_flat_pass.php | 3 +- .../tests/files/docblock_align_pass.php | 35 ++++++------- .../tests/files/for_function_comment_pass.php | 18 +++---- .../function_comment_opening_line_fail.php | 13 ----- .../files/function_comment_type_fail.php | 14 ------ .../files/function_comment_type_pass.php | 49 ------------------ .../FHComplete/tests/files/mixing_indent.php | 6 --- .../FHComplete/tests/files/multiple_use.php | 6 --- .../tests/files/multiple_use_pass.php | 9 ---- .../tests/files/operator_spacing_pass.php | 11 ++-- .../FHComplete/tests/files/space_tab.php | 2 +- .../tests/files/traits_no_order.php | 9 ++-- .../FHComplete/tests/files/traits_pass.php | 11 ++-- .../tests/files/type_casting_fail.php | 4 -- .../tests/files/type_casting_pass.php | 4 -- .../files/use_class_and_closure_pass.php | 22 -------- .../tests/files/use_closure_pass.php | 8 --- .../FHComplete/tests/files/use_no_order.php | 8 --- .../FHComplete/tests/files/use_ok_pass.php | 10 ---- .../tests/files/use_with_commas.php | 7 --- .../tests/files/variable_name_pass.php | 45 ----------------- .../tests/files/whitespace_comma.php | 2 - .../tests/files/whitespace_comma_before.php | 2 - .../tests/files/whitespace_comma_pass.php | 2 - 31 files changed, 107 insertions(+), 302 deletions(-) delete mode 100644 tests/codesniffer/FHComplete/tests/files/function_comment_opening_line_fail.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/function_comment_type_fail.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/function_comment_type_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/mixing_indent.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/multiple_use.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/multiple_use_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/type_casting_fail.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/type_casting_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/use_class_and_closure_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/use_closure_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/use_no_order.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/use_ok_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/use_with_commas.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/variable_name_pass.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/whitespace_comma.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/whitespace_comma_before.php delete mode 100644 tests/codesniffer/FHComplete/tests/files/whitespace_comma_pass.php diff --git a/tests/codesniffer/FHComplete/tests/files/FHComplete/throws_pass.php b/tests/codesniffer/FHComplete/tests/files/FHComplete/throws_pass.php index 854344b5b..b2c1d2a04 100644 --- a/tests/codesniffer/FHComplete/tests/files/FHComplete/throws_pass.php +++ b/tests/codesniffer/FHComplete/tests/files/FHComplete/throws_pass.php @@ -8,29 +8,29 @@ use Other\Error as OtherError; class Throws { - /** - * Test throws - * - * @throws Exception An expection happened. - * @throws FHComplete\Boom A boom went off. - * @throws FHComplete\Error\Boom Oh, shucks, another boom. - * @throws Other\Crap Oh boy. - * @throws Other\Error\Issue A missing tissue for your PSR-2 issues. - * @return void - */ - public function test() - { - switch ($a) { - case 1: - throw new Boom(); - case 2: - throw new Error\Boom(); - case 3: - throw new OtherError\Issue(); - case 4: - throw new Crap(); - default: - throw new \Exception(); - } - } + /** + * Test throws + * + * @throws Exception An expection happened. + * @throws FHComplete\Boom A boom went off. + * @throws FHComplete\Error\Boom Oh, shucks, another boom. + * @throws Other\Crap Oh boy. + * @throws Other\Error\Issue A missing tissue for your PSR-2 issues. + * @return void + */ + public function test() + { + switch ($a) { + case 1: + throw new Boom(); + case 2: + throw new Error\Boom(); + case 3: + throw new OtherError\Issue(); + case 4: + throw new Crap(); + default: + throw new \Exception(); + } + } } diff --git a/tests/codesniffer/FHComplete/tests/files/control_structure_brackets_pass.php b/tests/codesniffer/FHComplete/tests/files/control_structure_brackets_pass.php index 75c37ee8e..2584c3507 100644 --- a/tests/codesniffer/FHComplete/tests/files/control_structure_brackets_pass.php +++ b/tests/codesniffer/FHComplete/tests/files/control_structure_brackets_pass.php @@ -1,19 +1,25 @@ 100) { +} +elseif ($i > 100) +{ echo 'i > 100'; } -while (false) { +while (false) +{ echo 'false'; } -do { +do +{ echo 'dowhile test'; } while (false); diff --git a/tests/codesniffer/FHComplete/tests/files/control_structure_dowhile.php b/tests/codesniffer/FHComplete/tests/files/control_structure_dowhile.php index 54b2190d4..b423a48e0 100644 --- a/tests/codesniffer/FHComplete/tests/files/control_structure_dowhile.php +++ b/tests/codesniffer/FHComplete/tests/files/control_structure_dowhile.php @@ -1,6 +1,7 @@ 'after 2 tabs' - ); -} diff --git a/tests/codesniffer/FHComplete/tests/files/multiple_use.php b/tests/codesniffer/FHComplete/tests/files/multiple_use.php deleted file mode 100644 index b239a6419..000000000 --- a/tests/codesniffer/FHComplete/tests/files/multiple_use.php +++ /dev/null @@ -1,6 +0,0 @@ -passingPublic = 'changed'; - $this->underscored = 'has value now'; - $this->doubleUnderscore = 'not recommended'; - } - - /** - * [setStatics description] - * - * @return void - */ - public static function setStatics() - { - self::$publicStatic = true; - self::$protectedStatic = true; - self::$privateStatic = true; - } -} diff --git a/tests/codesniffer/FHComplete/tests/files/whitespace_comma.php b/tests/codesniffer/FHComplete/tests/files/whitespace_comma.php deleted file mode 100644 index 78e43d5f0..000000000 --- a/tests/codesniffer/FHComplete/tests/files/whitespace_comma.php +++ /dev/null @@ -1,2 +0,0 @@ -