diff --git a/.php_cs.dist b/.php_cs.dist index 2ba3314e971..1c10a3a1640 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -29,7 +29,9 @@ return PhpCsFixer\Config::create() ->setRules([ 'align_multiline_comment' => true, 'array_indentation' => true, + 'array_push' => true, 'array_syntax' => ['syntax' => 'short'], + 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => [ 'operators' => [ '=' => 'align_single_space_minimal', @@ -65,21 +67,29 @@ return PhpCsFixer\Config::create() 'braces' => true, 'cast_spaces' => true, 'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], + 'class_definition' => true, + 'clean_namespace' => true, 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, + 'combine_nested_dirname' => true, 'compact_nullable_typehint' => true, 'concat_space' => ['spacing' => 'one'], 'constant_case' => true, 'declare_equal_normalize' => ['space' => 'none'], 'declare_strict_types' => true, 'dir_constant' => true, + 'echo_tag_syntax' => true, 'elseif' => true, 'encoding' => true, + 'ereg_to_preg' => true, 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, + 'fopen_flag_order' => true, 'full_opening_tag' => true, 'fully_qualified_strict_types' => true, 'function_declaration' => true, + 'function_to_constant' => true, + 'function_typehint_space' => true, 'global_namespace_import' => [ 'import_classes' => true, 'import_constants' => true, @@ -87,14 +97,18 @@ return PhpCsFixer\Config::create() ], 'header_comment' => ['header' => $header, 'separate' => 'none'], 'heredoc_to_nowdoc' => true, + 'implode_call' => true, + 'include' => true, 'increment_style' => [ 'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST, ], 'indentation_type' => true, 'is_null' => true, + 'lambda_not_used_import' => true, 'line_ending' => true, 'list_syntax' => ['syntax' => 'short'], 'logical_operators' => true, + 'lowercase_cast' => true, 'lowercase_keywords' => true, 'lowercase_static_reference' => true, 'magic_constant_casing' => true, @@ -111,10 +125,13 @@ return PhpCsFixer\Config::create() 'native_function_type_declaration_casing' => true, 'new_with_braces' => false, 'no_alias_functions' => true, + 'no_alias_language_construct_call' => true, 'no_alternative_syntax' => true, + 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, 'no_blank_lines_before_namespace' => true, + 'no_break_comment' => true, 'no_closing_tag' => true, 'no_empty_comment' => true, 'no_empty_phpdoc' => true, @@ -128,7 +145,6 @@ return PhpCsFixer\Config::create() 'no_null_property_initialization' => true, 'no_php4_constructor' => true, 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_after_function_name' => true, 'no_spaces_around_offset' => true, @@ -141,19 +157,26 @@ return PhpCsFixer\Config::create() 'no_trailing_comma_in_singleline_array' => true, 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, + 'no_trailing_whitespace_in_string' => true, 'no_unneeded_control_parentheses' => true, 'no_unneeded_curly_braces' => true, 'no_unneeded_final_method' => true, 'no_unreachable_default_argument_value' => true, + 'no_unset_cast' => true, 'no_unset_on_property' => true, 'no_unused_imports' => true, 'no_useless_else' => true, 'no_useless_return' => true, + 'no_useless_sprintf' => true, 'no_whitespace_before_comma_in_array' => true, 'no_whitespace_in_blank_line' => true, 'non_printable_character' => true, 'normalize_index_brace' => true, 'object_operator_without_whitespace' => true, + 'operator_linebreak' => [ + 'only_booleans' => true, + 'position' => 'end', + ], 'ordered_class_elements' => [ 'order' => [ 'use_trait', @@ -189,24 +212,43 @@ return PhpCsFixer\Config::create() 'direction' => 'ascend', 'order' => 'alpha', ], + 'ordered_traits' => true, + 'php_unit_set_up_tear_down_visibility' => true, + 'php_unit_test_case_static_method_calls' => [ + 'call_type' => 'this', + ], 'phpdoc_add_missing_param_annotation' => false, 'phpdoc_align' => true, 'phpdoc_annotation_without_dot' => true, 'phpdoc_indent' => true, + 'phpdoc_inline_tag_normalizer' => true, 'phpdoc_no_access' => true, + 'phpdoc_no_alias_tag' => true, 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, + 'phpdoc_no_useless_inheritdoc' => true, 'phpdoc_order' => true, + 'phpdoc_order_by_value' => [ + 'annotations' => [ + 'covers', + 'dataProvider', + 'throws', + 'uses', + ], + ], 'phpdoc_return_self_reference' => true, 'phpdoc_scalar' => true, 'phpdoc_separation' => true, 'phpdoc_single_line_var_spacing' => true, 'phpdoc_summary' => true, + 'phpdoc_tag_casing' => true, + 'phpdoc_tag_type' => true, 'phpdoc_to_comment' => true, 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types' => ['groups' => ['simple', 'meta']], 'phpdoc_types_order' => true, + 'phpdoc_var_annotation_correct_order' => true, 'phpdoc_var_without_name' => true, 'pow_to_exponentiation' => true, 'protected_to_private' => true, @@ -220,11 +262,23 @@ return PhpCsFixer\Config::create() 'simple_to_complex_string_variable' => true, 'simplified_null_return' => false, 'single_blank_line_at_eof' => true, + 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, 'single_line_after_imports' => true, 'single_quote' => true, + 'single_space_after_construct' => true, + 'single_trait_insert_per_statement' => true, + 'space_after_semicolon' => true, + 'standardize_increment' => true, 'standardize_not_equals' => true, + 'static_lambda' => true, 'strict_param' => true, + 'string_line_ending' => true, + 'switch_case_semicolon_to_colon' => true, + 'switch_case_space' => true, + 'switch_continue_to_break' => true, + 'ternary_operator_spaces' => true, + 'ternary_to_elvis_operator' => true, 'ternary_to_null_coalescing' => true, 'trailing_comma_in_multiline_array' => true, 'trim_array_spaces' => true, diff --git a/src/Framework/Assert.php b/src/Framework/Assert.php index c4039819cf4..e76aef1a086 100644 --- a/src/Framework/Assert.php +++ b/src/Framework/Assert.php @@ -101,9 +101,9 @@ abstract class Assert * @param int|string $key * @param array|ArrayAccess $array * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertArrayHasKey($key, $array, string $message = ''): void { @@ -132,9 +132,9 @@ public static function assertArrayHasKey($key, $array, string $message = ''): vo * @param int|string $key * @param array|ArrayAccess $array * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertArrayNotHasKey($key, $array, string $message = ''): void { @@ -162,9 +162,9 @@ public static function assertArrayNotHasKey($key, $array, string $message = ''): /** * Asserts that a haystack contains a needle. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertContains($needle, iterable $haystack, string $message = ''): void { @@ -183,9 +183,9 @@ public static function assertContainsEquals($needle, iterable $haystack, string /** * Asserts that a haystack does not contain a needle. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertNotContains($needle, iterable $haystack, string $message = ''): void { @@ -206,8 +206,8 @@ public static function assertNotContainsEquals($needle, iterable $haystack, stri /** * Asserts that a haystack contains only values of a given type. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void { @@ -228,8 +228,8 @@ public static function assertContainsOnly(string $type, iterable $haystack, ?boo /** * Asserts that a haystack contains only instances of a given class name. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, string $message = ''): void { @@ -246,8 +246,8 @@ public static function assertContainsOnlyInstancesOf(string $className, iterable /** * Asserts that a haystack does not contain only values of a given type. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNativeType = null, string $message = ''): void { @@ -272,9 +272,9 @@ public static function assertNotContainsOnly(string $type, iterable $haystack, ? * * @param Countable|iterable $haystack * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertCount(int $expectedCount, $haystack, string $message = ''): void { @@ -294,9 +294,9 @@ public static function assertCount(int $expectedCount, $haystack, string $messag * * @param Countable|iterable $haystack * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertNotCount(int $expectedCount, $haystack, string $message = ''): void { @@ -314,8 +314,8 @@ public static function assertNotCount(int $expectedCount, $haystack, string $mes /** * Asserts that two variables are equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertEquals($expected, $actual, string $message = ''): void { @@ -327,8 +327,8 @@ public static function assertEquals($expected, $actual, string $message = ''): v /** * Asserts that two variables are equal (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertEqualsCanonicalizing($expected, $actual, string $message = ''): void { @@ -340,8 +340,8 @@ public static function assertEqualsCanonicalizing($expected, $actual, string $me /** * Asserts that two variables are equal (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertEqualsIgnoringCase($expected, $actual, string $message = ''): void { @@ -353,8 +353,8 @@ public static function assertEqualsIgnoringCase($expected, $actual, string $mess /** * Asserts that two variables are equal (with delta). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void { @@ -369,8 +369,8 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s /** * Asserts that two variables are not equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotEquals($expected, $actual, string $message = ''): void { @@ -384,8 +384,8 @@ public static function assertNotEquals($expected, $actual, string $message = '') /** * Asserts that two variables are not equal (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void { @@ -399,8 +399,8 @@ public static function assertNotEqualsCanonicalizing($expected, $actual, string /** * Asserts that two variables are not equal (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void { @@ -414,8 +414,8 @@ public static function assertNotEqualsIgnoringCase($expected, $actual, string $m /** * Asserts that two variables are not equal (with delta). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotEqualsWithDelta($expected, $actual, float $delta, string $message = ''): void { @@ -444,8 +444,8 @@ public static function assertObjectEquals(object $expected, object $actual, stri /** * Asserts that a variable is empty. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert empty $actual */ @@ -457,8 +457,8 @@ public static function assertEmpty($actual, string $message = ''): void /** * Asserts that a variable is not empty. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !empty $actual */ @@ -470,8 +470,8 @@ public static function assertNotEmpty($actual, string $message = ''): void /** * Asserts that a value is greater than another value. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertGreaterThan($expected, $actual, string $message = ''): void { @@ -481,8 +481,8 @@ public static function assertGreaterThan($expected, $actual, string $message = ' /** * Asserts that a value is greater than or equal to another value. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertGreaterThanOrEqual($expected, $actual, string $message = ''): void { @@ -496,8 +496,8 @@ public static function assertGreaterThanOrEqual($expected, $actual, string $mess /** * Asserts that a value is smaller than another value. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertLessThan($expected, $actual, string $message = ''): void { @@ -507,8 +507,8 @@ public static function assertLessThan($expected, $actual, string $message = ''): /** * Asserts that a value is smaller than or equal to another value. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertLessThanOrEqual($expected, $actual, string $message = ''): void { @@ -519,8 +519,8 @@ public static function assertLessThanOrEqual($expected, $actual, string $message * Asserts that the contents of one file is equal to the contents of another * file. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileEquals(string $expected, string $actual, string $message = ''): void { @@ -536,8 +536,8 @@ public static function assertFileEquals(string $expected, string $actual, string * Asserts that the contents of one file is equal to the contents of another * file (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void { @@ -555,8 +555,8 @@ public static function assertFileEqualsCanonicalizing(string $expected, string $ * Asserts that the contents of one file is equal to the contents of another * file (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void { @@ -572,8 +572,8 @@ public static function assertFileEqualsIgnoringCase(string $expected, string $ac * Asserts that the contents of one file is not equal to the contents of * another file. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileNotEquals(string $expected, string $actual, string $message = ''): void { @@ -591,8 +591,8 @@ public static function assertFileNotEquals(string $expected, string $actual, str * Asserts that the contents of one file is not equal to the contents of another * file (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileNotEqualsCanonicalizing(string $expected, string $actual, string $message = ''): void { @@ -610,8 +610,8 @@ public static function assertFileNotEqualsCanonicalizing(string $expected, strin * Asserts that the contents of one file is not equal to the contents of another * file (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileNotEqualsIgnoringCase(string $expected, string $actual, string $message = ''): void { @@ -629,8 +629,8 @@ public static function assertFileNotEqualsIgnoringCase(string $expected, string * Asserts that the contents of a string is equal * to the contents of a file. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = ''): void { @@ -645,8 +645,8 @@ public static function assertStringEqualsFile(string $expectedFile, string $actu * Asserts that the contents of a string is equal * to the contents of a file (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void { @@ -661,8 +661,8 @@ public static function assertStringEqualsFileCanonicalizing(string $expectedFile * Asserts that the contents of a string is equal * to the contents of a file (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void { @@ -677,8 +677,8 @@ public static function assertStringEqualsFileIgnoringCase(string $expectedFile, * Asserts that the contents of a string is not equal * to the contents of a file. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = ''): void { @@ -695,8 +695,8 @@ public static function assertStringNotEqualsFile(string $expectedFile, string $a * Asserts that the contents of a string is not equal * to the contents of a file (canonicalizing). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $actualString, string $message = ''): void { @@ -713,8 +713,8 @@ public static function assertStringNotEqualsFileCanonicalizing(string $expectedF * Asserts that the contents of a string is not equal * to the contents of a file (ignoring case). * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $actualString, string $message = ''): void { @@ -730,8 +730,8 @@ public static function assertStringNotEqualsFileIgnoringCase(string $expectedFil /** * Asserts that a file/dir is readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertIsReadable(string $filename, string $message = ''): void { @@ -741,8 +741,8 @@ public static function assertIsReadable(string $filename, string $message = ''): /** * Asserts that a file/dir exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertIsNotReadable(string $filename, string $message = ''): void { @@ -752,8 +752,8 @@ public static function assertIsNotReadable(string $filename, string $message = ' /** * Asserts that a file/dir exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -769,8 +769,8 @@ public static function assertNotIsReadable(string $filename, string $message = ' /** * Asserts that a file/dir exists and is writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertIsWritable(string $filename, string $message = ''): void { @@ -780,8 +780,8 @@ public static function assertIsWritable(string $filename, string $message = ''): /** * Asserts that a file/dir exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertIsNotWritable(string $filename, string $message = ''): void { @@ -791,8 +791,8 @@ public static function assertIsNotWritable(string $filename, string $message = ' /** * Asserts that a file/dir exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -808,8 +808,8 @@ public static function assertNotIsWritable(string $filename, string $message = ' /** * Asserts that a directory exists. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryExists(string $directory, string $message = ''): void { @@ -819,8 +819,8 @@ public static function assertDirectoryExists(string $directory, string $message /** * Asserts that a directory does not exist. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryDoesNotExist(string $directory, string $message = ''): void { @@ -830,8 +830,8 @@ public static function assertDirectoryDoesNotExist(string $directory, string $me /** * Asserts that a directory does not exist. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -847,8 +847,8 @@ public static function assertDirectoryNotExists(string $directory, string $messa /** * Asserts that a directory exists and is readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryIsReadable(string $directory, string $message = ''): void { @@ -859,8 +859,8 @@ public static function assertDirectoryIsReadable(string $directory, string $mess /** * Asserts that a directory exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryIsNotReadable(string $directory, string $message = ''): void { @@ -871,8 +871,8 @@ public static function assertDirectoryIsNotReadable(string $directory, string $m /** * Asserts that a directory exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -889,8 +889,8 @@ public static function assertDirectoryNotIsReadable(string $directory, string $m /** * Asserts that a directory exists and is writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryIsWritable(string $directory, string $message = ''): void { @@ -901,8 +901,8 @@ public static function assertDirectoryIsWritable(string $directory, string $mess /** * Asserts that a directory exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDirectoryIsNotWritable(string $directory, string $message = ''): void { @@ -913,8 +913,8 @@ public static function assertDirectoryIsNotWritable(string $directory, string $m /** * Asserts that a directory exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -931,8 +931,8 @@ public static function assertDirectoryNotIsWritable(string $directory, string $m /** * Asserts that a file exists. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileExists(string $filename, string $message = ''): void { @@ -942,8 +942,8 @@ public static function assertFileExists(string $filename, string $message = ''): /** * Asserts that a file does not exist. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileDoesNotExist(string $filename, string $message = ''): void { @@ -953,8 +953,8 @@ public static function assertFileDoesNotExist(string $filename, string $message /** * Asserts that a file does not exist. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -970,8 +970,8 @@ public static function assertFileNotExists(string $filename, string $message = ' /** * Asserts that a file exists and is readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileIsReadable(string $file, string $message = ''): void { @@ -982,8 +982,8 @@ public static function assertFileIsReadable(string $file, string $message = ''): /** * Asserts that a file exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileIsNotReadable(string $file, string $message = ''): void { @@ -994,8 +994,8 @@ public static function assertFileIsNotReadable(string $file, string $message = ' /** * Asserts that a file exists and is not readable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -1012,8 +1012,8 @@ public static function assertFileNotIsReadable(string $file, string $message = ' /** * Asserts that a file exists and is writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileIsWritable(string $file, string $message = ''): void { @@ -1024,8 +1024,8 @@ public static function assertFileIsWritable(string $file, string $message = ''): /** * Asserts that a file exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFileIsNotWritable(string $file, string $message = ''): void { @@ -1036,8 +1036,8 @@ public static function assertFileIsNotWritable(string $file, string $message = ' /** * Asserts that a file exists and is not writable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -1054,8 +1054,8 @@ public static function assertFileNotIsWritable(string $file, string $message = ' /** * Asserts that a condition is true. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert true $condition */ @@ -1067,8 +1067,8 @@ public static function assertTrue($condition, string $message = ''): void /** * Asserts that a condition is not true. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !true $condition */ @@ -1080,8 +1080,8 @@ public static function assertNotTrue($condition, string $message = ''): void /** * Asserts that a condition is false. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert false $condition */ @@ -1093,8 +1093,8 @@ public static function assertFalse($condition, string $message = ''): void /** * Asserts that a condition is not false. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !false $condition */ @@ -1106,8 +1106,8 @@ public static function assertNotFalse($condition, string $message = ''): void /** * Asserts that a variable is null. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert null $actual */ @@ -1119,8 +1119,8 @@ public static function assertNull($actual, string $message = ''): void /** * Asserts that a variable is not null. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !null $actual */ @@ -1132,8 +1132,8 @@ public static function assertNotNull($actual, string $message = ''): void /** * Asserts that a variable is finite. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertFinite($actual, string $message = ''): void { @@ -1143,8 +1143,8 @@ public static function assertFinite($actual, string $message = ''): void /** * Asserts that a variable is infinite. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertInfinite($actual, string $message = ''): void { @@ -1154,8 +1154,8 @@ public static function assertInfinite($actual, string $message = ''): void /** * Asserts that a variable is nan. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNan($actual, string $message = ''): void { @@ -1165,9 +1165,9 @@ public static function assertNan($actual, string $message = ''): void /** * Asserts that a class has a specified attribute. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void { @@ -1185,9 +1185,9 @@ public static function assertClassHasAttribute(string $attributeName, string $cl /** * Asserts that a class does not have a specified attribute. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void { @@ -1211,9 +1211,9 @@ public static function assertClassNotHasAttribute(string $attributeName, string /** * Asserts that a class has a specified static attribute. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { @@ -1235,9 +1235,9 @@ public static function assertClassHasStaticAttribute(string $attributeName, stri /** * Asserts that a class does not have a specified static attribute. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { @@ -1263,9 +1263,9 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s * * @param object $object * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void { @@ -1289,9 +1289,9 @@ public static function assertObjectHasAttribute(string $attributeName, $object, * * @param object $object * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void { @@ -1317,8 +1317,8 @@ public static function assertObjectNotHasAttribute(string $attributeName, $objec * Used on objects, it asserts that two variables reference * the same object. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-template ExpectedType * @psalm-param ExpectedType $expected @@ -1338,8 +1338,8 @@ public static function assertSame($expected, $actual, string $message = ''): voi * Used on objects, it asserts that two variables do not reference * the same object. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertNotSame($expected, $actual, string $message = ''): void { @@ -1359,9 +1359,9 @@ public static function assertNotSame($expected, $actual, string $message = ''): /** * Asserts that a variable is of a given type. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException * * @psalm-template ExpectedType of object * @psalm-param class-string $expected @@ -1383,9 +1383,9 @@ public static function assertInstanceOf(string $expected, $actual, string $messa /** * Asserts that a variable is not of a given type. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException * * @psalm-template ExpectedType of object * @psalm-param class-string $expected @@ -1409,8 +1409,8 @@ public static function assertNotInstanceOf(string $expected, $actual, string $me /** * Asserts that a variable is of type array. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert array $actual */ @@ -1426,8 +1426,8 @@ public static function assertIsArray($actual, string $message = ''): void /** * Asserts that a variable is of type bool. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert bool $actual */ @@ -1443,8 +1443,8 @@ public static function assertIsBool($actual, string $message = ''): void /** * Asserts that a variable is of type float. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert float $actual */ @@ -1460,8 +1460,8 @@ public static function assertIsFloat($actual, string $message = ''): void /** * Asserts that a variable is of type int. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert int $actual */ @@ -1477,8 +1477,8 @@ public static function assertIsInt($actual, string $message = ''): void /** * Asserts that a variable is of type numeric. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert numeric $actual */ @@ -1494,8 +1494,8 @@ public static function assertIsNumeric($actual, string $message = ''): void /** * Asserts that a variable is of type object. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert object $actual */ @@ -1511,8 +1511,8 @@ public static function assertIsObject($actual, string $message = ''): void /** * Asserts that a variable is of type resource. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert resource $actual */ @@ -1528,8 +1528,8 @@ public static function assertIsResource($actual, string $message = ''): void /** * Asserts that a variable is of type resource and is closed. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert resource $actual */ @@ -1545,8 +1545,8 @@ public static function assertIsClosedResource($actual, string $message = ''): vo /** * Asserts that a variable is of type string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert string $actual */ @@ -1562,8 +1562,8 @@ public static function assertIsString($actual, string $message = ''): void /** * Asserts that a variable is of type scalar. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert scalar $actual */ @@ -1579,8 +1579,8 @@ public static function assertIsScalar($actual, string $message = ''): void /** * Asserts that a variable is of type callable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert callable $actual */ @@ -1596,8 +1596,8 @@ public static function assertIsCallable($actual, string $message = ''): void /** * Asserts that a variable is of type iterable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert iterable $actual */ @@ -1613,8 +1613,8 @@ public static function assertIsIterable($actual, string $message = ''): void /** * Asserts that a variable is not of type array. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !array $actual */ @@ -1630,8 +1630,8 @@ public static function assertIsNotArray($actual, string $message = ''): void /** * Asserts that a variable is not of type bool. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !bool $actual */ @@ -1647,8 +1647,8 @@ public static function assertIsNotBool($actual, string $message = ''): void /** * Asserts that a variable is not of type float. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !float $actual */ @@ -1664,8 +1664,8 @@ public static function assertIsNotFloat($actual, string $message = ''): void /** * Asserts that a variable is not of type int. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !int $actual */ @@ -1681,8 +1681,8 @@ public static function assertIsNotInt($actual, string $message = ''): void /** * Asserts that a variable is not of type numeric. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !numeric $actual */ @@ -1698,8 +1698,8 @@ public static function assertIsNotNumeric($actual, string $message = ''): void /** * Asserts that a variable is not of type object. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !object $actual */ @@ -1715,8 +1715,8 @@ public static function assertIsNotObject($actual, string $message = ''): void /** * Asserts that a variable is not of type resource. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !resource $actual */ @@ -1732,8 +1732,8 @@ public static function assertIsNotResource($actual, string $message = ''): void /** * Asserts that a variable is not of type resource. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !resource $actual */ @@ -1749,8 +1749,8 @@ public static function assertIsNotClosedResource($actual, string $message = ''): /** * Asserts that a variable is not of type string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !string $actual */ @@ -1766,8 +1766,8 @@ public static function assertIsNotString($actual, string $message = ''): void /** * Asserts that a variable is not of type scalar. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !scalar $actual */ @@ -1783,8 +1783,8 @@ public static function assertIsNotScalar($actual, string $message = ''): void /** * Asserts that a variable is not of type callable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !callable $actual */ @@ -1800,8 +1800,8 @@ public static function assertIsNotCallable($actual, string $message = ''): void /** * Asserts that a variable is not of type iterable. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-assert !iterable $actual */ @@ -1817,8 +1817,8 @@ public static function assertIsNotIterable($actual, string $message = ''): void /** * Asserts that a string matches a given regular expression. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertMatchesRegularExpression(string $pattern, string $string, string $message = ''): void { @@ -1828,8 +1828,8 @@ public static function assertMatchesRegularExpression(string $pattern, string $s /** * Asserts that a string matches a given regular expression. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -1845,8 +1845,8 @@ public static function assertRegExp(string $pattern, string $string, string $mes /** * Asserts that a string does not match a given regular expression. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertDoesNotMatchRegularExpression(string $pattern, string $string, string $message = ''): void { @@ -1862,8 +1862,8 @@ public static function assertDoesNotMatchRegularExpression(string $pattern, stri /** * Asserts that a string does not match a given regular expression. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @codeCoverageIgnore * @@ -1889,9 +1889,9 @@ public static function assertNotRegExp(string $pattern, string $string, string $ * @param Countable|iterable $expected * @param Countable|iterable $actual * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertSameSize($expected, $actual, string $message = ''): void { @@ -1917,9 +1917,9 @@ public static function assertSameSize($expected, $actual, string $message = ''): * @param Countable|iterable $expected * @param Countable|iterable $actual * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertNotSameSize($expected, $actual, string $message = ''): void { @@ -1943,8 +1943,8 @@ public static function assertNotSameSize($expected, $actual, string $message = ' /** * Asserts that a string matches a given format string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringMatchesFormat(string $format, string $string, string $message = ''): void { @@ -1954,8 +1954,8 @@ public static function assertStringMatchesFormat(string $format, string $string, /** * Asserts that a string does not match a given format string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void { @@ -1971,8 +1971,8 @@ public static function assertStringNotMatchesFormat(string $format, string $stri /** * Asserts that a string matches a given format file. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringMatchesFormatFile(string $formatFile, string $string, string $message = ''): void { @@ -1990,8 +1990,8 @@ public static function assertStringMatchesFormatFile(string $formatFile, string /** * Asserts that a string does not match a given format string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void { @@ -2011,8 +2011,8 @@ public static function assertStringNotMatchesFormatFile(string $formatFile, stri /** * Asserts that a string starts with a given prefix. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringStartsWith(string $prefix, string $string, string $message = ''): void { @@ -2025,8 +2025,8 @@ public static function assertStringStartsWith(string $prefix, string $string, st * @param string $prefix * @param string $string * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringStartsNotWith($prefix, $string, string $message = ''): void { @@ -2040,8 +2040,8 @@ public static function assertStringStartsNotWith($prefix, $string, string $messa } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringContainsString(string $needle, string $haystack, string $message = ''): void { @@ -2051,8 +2051,8 @@ public static function assertStringContainsString(string $needle, string $haysta } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void { @@ -2062,8 +2062,8 @@ public static function assertStringContainsStringIgnoringCase(string $needle, st } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotContainsString(string $needle, string $haystack, string $message = ''): void { @@ -2073,8 +2073,8 @@ public static function assertStringNotContainsString(string $needle, string $hay } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringNotContainsStringIgnoringCase(string $needle, string $haystack, string $message = ''): void { @@ -2086,8 +2086,8 @@ public static function assertStringNotContainsStringIgnoringCase(string $needle, /** * Asserts that a string ends with a given suffix. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringEndsWith(string $suffix, string $string, string $message = ''): void { @@ -2097,8 +2097,8 @@ public static function assertStringEndsWith(string $suffix, string $string, stri /** * Asserts that a string ends not with a given suffix. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertStringEndsNotWith(string $suffix, string $string, string $message = ''): void { @@ -2114,9 +2114,9 @@ public static function assertStringEndsNotWith(string $suffix, string $string, s /** * Asserts that two XML files are equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void { @@ -2129,9 +2129,9 @@ public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $ /** * Asserts that two XML files are not equal. * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws \PHPUnit\Util\Exception + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void { @@ -2146,9 +2146,9 @@ public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, strin * * @param DOMDocument|string $actualXml * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -2170,9 +2170,9 @@ public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actua * * @param DOMDocument|string $actualXml * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -2195,9 +2195,9 @@ public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $ac * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -2226,9 +2226,9 @@ public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -2254,9 +2254,9 @@ public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXm /** * Asserts that a hierarchy of DOMElements matches. * + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws AssertionFailedError * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * * @codeCoverageIgnore * @@ -2334,8 +2334,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME /** * Evaluates a PHPUnit\Framework\Constraint matcher object. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertThat($value, Constraint $constraint, string $message = ''): void { @@ -2347,8 +2347,8 @@ public static function assertThat($value, Constraint $constraint, string $messag /** * Asserts that a string is a valid JSON string. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJson(string $actualJson, string $message = ''): void { @@ -2358,8 +2358,8 @@ public static function assertJson(string $actualJson, string $message = ''): voi /** * Asserts that two given JSON encoded objects or arrays are equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJson, string $message = ''): void { @@ -2375,8 +2375,8 @@ public static function assertJsonStringEqualsJsonString(string $expectedJson, st * @param string $expectedJson * @param string $actualJson * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string $message = ''): void { @@ -2395,8 +2395,8 @@ public static function assertJsonStringNotEqualsJsonString($expectedJson, $actua /** * Asserts that the generated JSON encoded object and the content of the given file are equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void { @@ -2412,8 +2412,8 @@ public static function assertJsonStringEqualsJsonFile(string $expectedFile, stri /** * Asserts that the generated JSON encoded object and the content of the given file are not equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJson, string $message = ''): void { @@ -2435,8 +2435,8 @@ public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, s /** * Asserts that two JSON files are equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void { @@ -2462,8 +2462,8 @@ public static function assertJsonFileEqualsJsonFile(string $expectedFile, string /** * Asserts that two JSON files are not equal. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, string $actualFile, string $message = ''): void { diff --git a/src/Framework/Constraint/Constraint.php b/src/Framework/Constraint/Constraint.php index d9284c29559..c012d6275a1 100644 --- a/src/Framework/Constraint/Constraint.php +++ b/src/Framework/Constraint/Constraint.php @@ -36,8 +36,8 @@ abstract class Constraint implements Countable, SelfDescribing * a boolean value instead: true in case of success, false in case of a * failure. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { @@ -96,8 +96,8 @@ protected function matches($other): bool * @param string $description Additional information about the test * @param ComparisonFailure $comparisonFailure * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-return never-return */ diff --git a/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php b/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php index 418ad048f14..fd0db1c8fc5 100644 --- a/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php +++ b/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php @@ -39,8 +39,8 @@ public function toString(): string * * @param \PHPUnit\Framework\Exception $other * - * @throws Exception * @throws \PHPUnit\Framework\Exception + * @throws Exception */ protected function matches($other): bool { diff --git a/src/Framework/Constraint/IsIdentical.php b/src/Framework/Constraint/IsIdentical.php index 8fdc0cd153d..b49d992938d 100644 --- a/src/Framework/Constraint/IsIdentical.php +++ b/src/Framework/Constraint/IsIdentical.php @@ -51,8 +51,8 @@ public function __construct($value) * a boolean value instead: true in case of success, false in case of a * failure. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { diff --git a/src/Framework/Constraint/JsonMatches.php b/src/Framework/Constraint/JsonMatches.php index 882eb7a8661..23a4de7e99f 100644 --- a/src/Framework/Constraint/JsonMatches.php +++ b/src/Framework/Constraint/JsonMatches.php @@ -73,9 +73,9 @@ protected function matches($other): bool * @param string $description Additional information about the test * @param ComparisonFailure $comparisonFailure * - * @throws ExpectationFailedException * @throws \PHPUnit\Framework\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException * * @psalm-return never-return */ diff --git a/src/Framework/Constraint/Object/ObjectEquals.php b/src/Framework/Constraint/Object/ObjectEquals.php index 9819c7afdd4..30f3a330caa 100644 --- a/src/Framework/Constraint/Object/ObjectEquals.php +++ b/src/Framework/Constraint/Object/ObjectEquals.php @@ -48,11 +48,11 @@ public function toString(): string /** * @throws ActualValueIsNotAnObjectException - * @throws ComparisonMethodDoesNotExistException + * @throws ComparisonMethodDoesNotAcceptParameterTypeException * @throws ComparisonMethodDoesNotDeclareBoolReturnTypeException * @throws ComparisonMethodDoesNotDeclareExactlyOneParameterException * @throws ComparisonMethodDoesNotDeclareParameterTypeException - * @throws ComparisonMethodDoesNotAcceptParameterTypeException + * @throws ComparisonMethodDoesNotExistException */ protected function matches($other): bool { diff --git a/src/Framework/Constraint/Operator/LogicalNot.php b/src/Framework/Constraint/Operator/LogicalNot.php index 8a22cdc9372..a89d6780d5f 100644 --- a/src/Framework/Constraint/Operator/LogicalNot.php +++ b/src/Framework/Constraint/Operator/LogicalNot.php @@ -50,7 +50,7 @@ public static function negate(string $string): string preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - $positives = array_map(function (string $s) { + $positives = array_map(static function (string $s) { return '/\\b' . preg_quote($s, '/') . '/'; }, $positives); diff --git a/src/Framework/Constraint/Traversable/TraversableContainsOnly.php b/src/Framework/Constraint/Traversable/TraversableContainsOnly.php index f975d1d839d..cf4a46b4221 100644 --- a/src/Framework/Constraint/Traversable/TraversableContainsOnly.php +++ b/src/Framework/Constraint/Traversable/TraversableContainsOnly.php @@ -55,8 +55,8 @@ public function __construct(string $type, bool $isNativeType = true) * * @param mixed|Traversable $other * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { diff --git a/src/Framework/MockObject/Builder/InvocationMocker.php b/src/Framework/MockObject/Builder/InvocationMocker.php index 80a12426ba7..3f8312afc51 100644 --- a/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/src/Framework/MockObject/Builder/InvocationMocker.php @@ -171,9 +171,9 @@ public function after($id): self /** * @param mixed[] $arguments * + * @throws \PHPUnit\Framework\Exception * @throws MethodNameNotConfiguredException * @throws MethodParametersAlreadyConfiguredException - * @throws \PHPUnit\Framework\Exception * * @return $this */ @@ -189,9 +189,9 @@ public function with(...$arguments): self /** * @param array ...$arguments * + * @throws \PHPUnit\Framework\Exception * @throws MethodNameNotConfiguredException * @throws MethodParametersAlreadyConfiguredException - * @throws \PHPUnit\Framework\Exception * * @return $this */ @@ -222,9 +222,9 @@ public function withAnyParameters(): self /** * @param Constraint|string $constraint * - * @throws MethodNameAlreadyConfiguredException - * @throws MethodCannotBeConfiguredException * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws MethodCannotBeConfiguredException + * @throws MethodNameAlreadyConfiguredException * * @return $this */ diff --git a/src/Framework/MockObject/Generator.php b/src/Framework/MockObject/Generator.php index 9aae6ed86c7..cb8531cd33e 100644 --- a/src/Framework/MockObject/Generator.php +++ b/src/Framework/MockObject/Generator.php @@ -91,15 +91,15 @@ final class Generator * * @param null|array $methods * - * @throws ClassIsFinalException + * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException - * @throws ReflectionException - * @throws UnknownTypeException - * @throws InvalidMethodNameException + * @throws ClassIsFinalException * @throws DuplicateMethodException + * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException + * @throws ReflectionException * @throws RuntimeException - * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws UnknownTypeException */ public function getMock(string $type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject { @@ -181,16 +181,16 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri * @psalm-param class-string $originalClassName * @psalm-return MockObject&RealInstanceType * - * @throws RuntimeException - * @throws ReflectionException - * @throws ClassIsFinalException + * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException - * @throws UnknownTypeException - * @throws UnknownClassException - * @throws InvalidMethodNameException + * @throws ClassIsFinalException * @throws DuplicateMethodException + * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException - * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws ReflectionException + * @throws RuntimeException + * @throws UnknownClassException + * @throws UnknownTypeException */ public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject { @@ -242,17 +242,17 @@ interface_exists($originalClassName, $callAutoload)) { * * @psalm-param trait-string $traitName * - * @throws RuntimeException - * @throws ReflectionException - * @throws UnknownTraitException - * @throws ClassIsFinalException + * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException - * @throws UnknownTypeException - * @throws UnknownClassException - * @throws InvalidMethodNameException + * @throws ClassIsFinalException * @throws DuplicateMethodException + * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException - * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws ReflectionException + * @throws RuntimeException + * @throws UnknownClassException + * @throws UnknownTraitException + * @throws UnknownTypeException */ public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject { @@ -287,8 +287,8 @@ public function getMockForTrait(string $traitName, array $arguments = [], string * * @psalm-param trait-string $traitName * - * @throws RuntimeException * @throws ReflectionException + * @throws RuntimeException * @throws UnknownTraitException */ public function getObjectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = true, bool $callOriginalConstructor = false, array $arguments = []): object @@ -326,9 +326,9 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' } /** - * @throws RuntimeException - * @throws ReflectionException * @throws ClassIsFinalException + * @throws ReflectionException + * @throws RuntimeException */ public function generate(string $type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass { @@ -583,8 +583,8 @@ private function userDefinedInterfaceMethods(string $interfaceName): array } /** - * @throws RuntimeException * @throws ReflectionException + * @throws RuntimeException */ private function getObject(MockType $mockClass, $type = '', bool $callOriginalConstructor = false, bool $callAutoload = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true) { @@ -648,9 +648,9 @@ private function getObject(MockType $mockClass, $type = '', bool $callOriginalCo } /** - * @throws RuntimeException - * @throws ReflectionException * @throws ClassIsFinalException + * @throws ReflectionException + * @throws RuntimeException */ private function generateMock(string $type, ?array $explicitMethods, string $mockClassName, bool $callOriginalClone, bool $callAutoload, bool $cloneArguments, bool $callOriginalMethods): MockClass { diff --git a/src/Framework/MockObject/InvocationHandler.php b/src/Framework/MockObject/InvocationHandler.php index 342ae6e8310..b9d62610ae7 100644 --- a/src/Framework/MockObject/InvocationHandler.php +++ b/src/Framework/MockObject/InvocationHandler.php @@ -107,8 +107,8 @@ public function expects(InvocationOrder $rule): InvocationMocker } /** - * @throws RuntimeException * @throws Exception + * @throws RuntimeException */ public function invoke(Invocation $invocation) { diff --git a/src/Framework/MockObject/Matcher.php b/src/Framework/MockObject/Matcher.php index 408d8fa4577..a0f8817bdbe 100644 --- a/src/Framework/MockObject/Matcher.php +++ b/src/Framework/MockObject/Matcher.php @@ -103,10 +103,10 @@ public function setAfterMatchBuilderId(string $id): void } /** - * @throws MethodNameNotConfiguredException + * @throws ExpectationFailedException * @throws MatchBuilderNotFoundException + * @throws MethodNameNotConfiguredException * @throws RuntimeException - * @throws ExpectationFailedException */ public function invoked(Invocation $invocation) { @@ -156,11 +156,11 @@ public function invoked(Invocation $invocation) } /** - * @throws RuntimeException - * @throws MethodNameNotConfiguredException - * @throws MatchBuilderNotFoundException - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException + * @throws MatchBuilderNotFoundException + * @throws MethodNameNotConfiguredException + * @throws RuntimeException */ public function matches(Invocation $invocation): bool { @@ -208,9 +208,9 @@ public function matches(Invocation $invocation): bool } /** - * @throws MethodNameNotConfiguredException - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException + * @throws MethodNameNotConfiguredException */ public function verify(): void { diff --git a/src/Framework/MockObject/MockBuilder.php b/src/Framework/MockObject/MockBuilder.php index 3b0ce56114c..aec32a2d443 100644 --- a/src/Framework/MockObject/MockBuilder.php +++ b/src/Framework/MockObject/MockBuilder.php @@ -111,15 +111,15 @@ public function __construct(TestCase $testCase, $type) /** * Creates a mock object using a fluent interface. * - * @throws UnknownTypeException - * @throws InvalidMethodNameException - * @throws DuplicateMethodException - * @throws ClassIsFinalException + * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException + * @throws ClassIsFinalException + * @throws DuplicateMethodException + * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException - * @throws RuntimeException * @throws ReflectionException - * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws RuntimeException + * @throws UnknownTypeException * * @psalm-return MockObject&MockedType */ @@ -151,8 +151,8 @@ public function getMock(): MockObject * @psalm-return MockObject&MockedType * * @throws \PHPUnit\Framework\Exception - * @throws RuntimeException * @throws ReflectionException + * @throws RuntimeException */ public function getMockForAbstractClass(): MockObject { diff --git a/src/Framework/MockObject/Rule/ConsecutiveParameters.php b/src/Framework/MockObject/Rule/ConsecutiveParameters.php index e0dc55b9472..6025c0a1604 100644 --- a/src/Framework/MockObject/Rule/ConsecutiveParameters.php +++ b/src/Framework/MockObject/Rule/ConsecutiveParameters.php @@ -66,8 +66,8 @@ public function toString(): string } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function apply(BaseInvocation $invocation): void { @@ -93,8 +93,8 @@ public function verify(): void * * @param int $callIndex * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void { diff --git a/src/Framework/MockObject/Rule/Parameters.php b/src/Framework/MockObject/Rule/Parameters.php index 62230b00e5a..3f1cc53ae0d 100644 --- a/src/Framework/MockObject/Rule/Parameters.php +++ b/src/Framework/MockObject/Rule/Parameters.php @@ -92,8 +92,8 @@ public function apply(BaseInvocation $invocation): void * does the rule will get the invoked() method called which should check * if an expectation is met. * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function verify(): void { @@ -101,8 +101,8 @@ public function verify(): void } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ private function doVerify(): bool { diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index 59aec12ce5a..7f79d715bde 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -724,11 +724,11 @@ public function hasFailed(): bool * Runs the test case and collects the results in a TestResult object. * If no TestResult object is passed a new one will be created. * - * @throws CodeCoverageException - * @throws UtilException * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws CodeCoverageException + * @throws UtilException */ public function run(TestResult $result = null): TestResult { @@ -1504,10 +1504,10 @@ public function requires(): array /** * Override to run the test and assert its state. * + * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException * @throws AssertionFailedError * @throws Exception * @throws ExpectationFailedException - * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException * @throws Throwable */ protected function runTest() @@ -2008,9 +2008,9 @@ private function verifyMockObjects(): void } /** - * @throws Warning * @throws SkippedTestError * @throws SyntheticSkippedError + * @throws Warning */ private function checkRequirements(): void { @@ -2121,7 +2121,7 @@ private function markSkippedForNotSpecifyingDependency(): void $this->result->addError( $this, new SkippedTestError( - sprintf('This method has an invalid @depends annotation.') + 'This method has an invalid @depends annotation.' ), 0 ); @@ -2227,8 +2227,8 @@ private function snapshotGlobalState(): void } /** - * @throws RiskyTestError * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws RiskyTestError */ private function restoreGlobalState(): void { @@ -2324,8 +2324,8 @@ private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot } /** - * @throws RiskyTestError * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws RiskyTestError */ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): void { diff --git a/src/Framework/TestResult.php b/src/Framework/TestResult.php index 0ea5d31fd57..fc00628f1a0 100644 --- a/src/Framework/TestResult.php +++ b/src/Framework/TestResult.php @@ -627,10 +627,10 @@ public function getCollectCodeCoverageInformation(): bool /** * Runs a TestCase. * - * @throws CodeCoverageException - * @throws UnintentionallyCoveredCodeException * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws CodeCoverageException + * @throws UnintentionallyCoveredCodeException */ public function run(Test $test): void { diff --git a/src/Runner/PhptTestCase.php b/src/Runner/PhptTestCase.php index ea0ea7b8750..bdd3e97db50 100644 --- a/src/Runner/PhptTestCase.php +++ b/src/Runner/PhptTestCase.php @@ -111,10 +111,10 @@ public function count(): int /** * Runs a test and collects its result in a TestResult instance. * - * @throws Exception * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception */ public function run(TestResult $result = null): TestResult { @@ -352,9 +352,9 @@ private function parseEnvSection(string $content): array } /** - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws ExpectationFailedException */ private function assertPhptExpectation(array $sections, string $output): void { diff --git a/src/Runner/TestSuiteSorter.php b/src/Runner/TestSuiteSorter.php index 8fa4283274b..fcf2cdbb4c2 100644 --- a/src/Runner/TestSuiteSorter.php +++ b/src/Runner/TestSuiteSorter.php @@ -108,8 +108,8 @@ public function __construct(?TestResultCache $cache = null) } /** - * @throws Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception */ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = true): void { diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php index ccca0039b08..d8dc0581b5c 100644 --- a/src/TextUI/TestRunner.php +++ b/src/TextUI/TestRunner.php @@ -880,8 +880,8 @@ private function write(string $buffer): void } /** - * @throws Exception * @throws \PHPUnit\TextUI\XmlConfiguration\Exception + * @throws Exception */ private function handleConfiguration(array &$arguments): void { diff --git a/src/TextUI/XmlConfiguration/Migration/Migrator.php b/src/TextUI/XmlConfiguration/Migration/Migrator.php index 192e3670ec9..d173e7af24b 100644 --- a/src/TextUI/XmlConfiguration/Migration/Migrator.php +++ b/src/TextUI/XmlConfiguration/Migration/Migrator.php @@ -20,9 +20,9 @@ final class Migrator { /** + * @throws Exception * @throws MigrationBuilderException * @throws MigrationException - * @throws Exception * @throws XmlException */ public function migrate(string $filename): string diff --git a/src/Util/Annotation/DocBlock.php b/src/Util/Annotation/DocBlock.php index ab8c07b21e9..83d741e6bd4 100644 --- a/src/Util/Annotation/DocBlock.php +++ b/src/Util/Annotation/DocBlock.php @@ -337,14 +337,14 @@ public function symbolAnnotations(): array public function isHookToBeExecutedBeforeClass(): bool { - return $this->isMethod - && false !== strpos($this->docComment, '@beforeClass'); + return $this->isMethod && + false !== strpos($this->docComment, '@beforeClass'); } public function isHookToBeExecutedAfterClass(): bool { - return $this->isMethod - && false !== strpos($this->docComment, '@afterClass'); + return $this->isMethod && + false !== strpos($this->docComment, '@afterClass'); } public function isToBeExecutedBeforeTest(): bool @@ -534,7 +534,7 @@ private static function extractAnnotationsFromReflector(Reflector $reflector): a $annotations = array_merge( $annotations, ...array_map( - function (ReflectionClass $trait): array { + static function (ReflectionClass $trait): array { return self::parseDocBlock((string) $trait->getDocComment()); }, array_values($reflector->getTraits()) diff --git a/src/Util/PHP/AbstractPhpProcess.php b/src/Util/PHP/AbstractPhpProcess.php index f2c158980f1..b5de7144fe2 100644 --- a/src/Util/PHP/AbstractPhpProcess.php +++ b/src/Util/PHP/AbstractPhpProcess.php @@ -317,7 +317,7 @@ static function ($errno, $errstr, $errfile, $errline): void { $test->addToAssertionCount($childResult['numAssertions']); $childResult = $childResult['result']; - assert($childResult instanceof TestResult); + assert($childResult instanceof TestResult); if ($result->getCollectCodeCoverageInformation()) { $result->getCodeCoverage()->merge( diff --git a/src/Util/Test.php b/src/Util/Test.php index 3a646ae6d68..0778f2f52d1 100644 --- a/src/Util/Test.php +++ b/src/Util/Test.php @@ -753,7 +753,7 @@ private static function shouldCoversAnnotationBeUsed(array $annotations): bool * * Zend Framework (http://framework.zend.com/) * - * @link http://github.com/zendframework/zf2 for the canonical source repository + * @see http://github.com/zendframework/zf2 for the canonical source repository * * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License diff --git a/tests/basic/unit/fixtures/SetUpBeforeClassTest.php b/tests/basic/unit/fixtures/SetUpBeforeClassTest.php index fe4b7cdfec1..f9355a1d61f 100644 --- a/tests/basic/unit/fixtures/SetUpBeforeClassTest.php +++ b/tests/basic/unit/fixtures/SetUpBeforeClassTest.php @@ -32,7 +32,7 @@ public static function setUpBeforeClass(): void throw new Exception('forcing an Exception in setUpBeforeClass()'); } - public function setUp(): void + protected function setUp(): void { throw new Exception('setUp() should never have been run'); } diff --git a/tests/basic/unit/fixtures/SetUpTest.php b/tests/basic/unit/fixtures/SetUpTest.php index e9f48deb956..c0b4daa1fe9 100644 --- a/tests/basic/unit/fixtures/SetUpTest.php +++ b/tests/basic/unit/fixtures/SetUpTest.php @@ -25,7 +25,7 @@ */ class SetUpTest extends TestCase { - public function setUp(): void + protected function setUp(): void { throw new RuntimeException('throw exception in setUp'); } diff --git a/tests/end-to-end/regression/GitHub/2137/Issue2137Test.php b/tests/end-to-end/regression/GitHub/2137/Issue2137Test.php index 236caac9f5e..35803de65d6 100644 --- a/tests/end-to-end/regression/GitHub/2137/Issue2137Test.php +++ b/tests/end-to-end/regression/GitHub/2137/Issue2137Test.php @@ -12,9 +12,9 @@ class Issue2137Test extends PHPUnit\Framework\TestCase /** * @dataProvider provideBrandService * - * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception */ public function testBrandService($provided, $expected): void { @@ -32,9 +32,9 @@ public function provideBrandService() /** * @dataProvider provideBrandService * - * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception */ public function testSomethingElseInvalid($provided, $expected): void { diff --git a/tests/end-to-end/regression/GitHub/3093/Issue3093Test.php b/tests/end-to-end/regression/GitHub/3093/Issue3093Test.php index ea850df38f6..a9f84b8f2bf 100644 --- a/tests/end-to-end/regression/GitHub/3093/Issue3093Test.php +++ b/tests/end-to-end/regression/GitHub/3093/Issue3093Test.php @@ -16,7 +16,7 @@ public function someDataProvider(): array public function testFirstWithoutDependencies(): void { - self::assertTrue(true); + $this->assertTrue(true); } /** @@ -25,6 +25,6 @@ public function testFirstWithoutDependencies(): void */ public function testSecondThatDependsOnFirstAndDataprovider($value): void { - self::assertTrue(true); + $this->assertTrue(true); } } diff --git a/tests/unit/Framework/Assert/FunctionsTest.php b/tests/unit/Framework/Assert/FunctionsTest.php index 5df7402d48e..12d03e75a8a 100644 --- a/tests/unit/Framework/Assert/FunctionsTest.php +++ b/tests/unit/Framework/Assert/FunctionsTest.php @@ -54,7 +54,7 @@ public function provideStaticAssertionMethodNames(): array return array_reduce( $matches[1], - function (array $functionNames, string $functionName) { + static function (array $functionNames, string $functionName) { $functionNames[$functionName] = [$functionName]; return $functionNames; diff --git a/tests/unit/Framework/AssertTest.php b/tests/unit/Framework/AssertTest.php index e62d90ecd23..a4bc97a436a 100644 --- a/tests/unit/Framework/AssertTest.php +++ b/tests/unit/Framework/AssertTest.php @@ -263,8 +263,8 @@ public function notSameProvider(): array /** * @dataProvider equalProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertEqualsSucceeds($a, $b): void { @@ -274,8 +274,8 @@ public function testAssertEqualsSucceeds($a, $b): void /** * @dataProvider notEqualProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertEqualsFails($a, $b): void { @@ -287,8 +287,8 @@ public function testAssertEqualsFails($a, $b): void /** * @dataProvider notEqualProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertNotEqualsSucceeds($a, $b): void { @@ -299,8 +299,8 @@ public function testAssertNotEqualsSucceeds($a, $b): void * @testdox assertNotEquals($a, $b) with delta $delta, canoicalize $canonicalize, ignoreCase $ignoreCase * @dataProvider equalProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertNotEqualsFails($a, $b): void { @@ -313,8 +313,8 @@ public function testAssertNotEqualsFails($a, $b): void * @testdox assertNotSame($a, $b) fails * @dataProvider sameProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertSameSucceeds($a, $b): void { @@ -325,8 +325,8 @@ public function testAssertSameSucceeds($a, $b): void * @testdox assertNotSame($a, $b) * @dataProvider notSameProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertSameFails($a, $b): void { @@ -339,8 +339,8 @@ public function testAssertSameFails($a, $b): void * @testdox assertSame($a, $b) fails * @dataProvider notSameProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertNotSameSucceeds($a, $b): void { @@ -351,8 +351,8 @@ public function testAssertNotSameSucceeds($a, $b): void * @testdox assertSame($a, $b) * @dataProvider sameProvider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertNotSameFails($a, $b): void { @@ -551,7 +551,7 @@ public function testAssertDirectoryIsReadable(): void public function testAssertDirectoryIsNotReadable(): void { if (PHP_OS_FAMILY === 'Windows') { - self::markTestSkipped('Cannot test this behaviour on Windows'); + $this->markTestSkipped('Cannot test this behaviour on Windows'); } $dirName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('unreadable_dir_', true); @@ -581,7 +581,7 @@ public function testAssertDirectoryIsWritable(): void public function testAssertDirectoryIsNotWritable(): void { if (PHP_OS_FAMILY === 'Windows') { - self::markTestSkipped('Cannot test this behaviour on Windows'); + $this->markTestSkipped('Cannot test this behaviour on Windows'); } $dirName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('not_writable_dir_', true); @@ -629,7 +629,7 @@ public function testAssertFileIsReadable(): void public function testAssertFileIsNotReadable(): void { if (PHP_OS_FAMILY === 'Windows') { - self::markTestSkipped('Cannot test this behaviour on Windows'); + $this->markTestSkipped('Cannot test this behaviour on Windows'); } $tempFile = tempnam( @@ -1339,7 +1339,7 @@ public function testAssertThatCallback(): void { $this->assertThat( null, - $this->callback(function ($other) { + $this->callback(static function ($other) { return true; }) ); @@ -1706,8 +1706,8 @@ public function testAssertJsonStringEqualsJsonString(): void /** * @dataProvider validInvalidJsonDataprovider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertJsonStringEqualsJsonStringErrorRaised($expected, $actual): void { @@ -1729,8 +1729,8 @@ public function testAssertJsonStringNotEqualsJsonString(): void * @testdox Assert JSON string equals equals JSON string raised $_dataName * @dataProvider validInvalidJsonDataprovider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testAssertJsonStringNotEqualsJsonStringErrorRaised($expected, $actual): void { @@ -2029,7 +2029,7 @@ public function testScalarTypeCanBeAsserted(): void public function testCallableTypeCanBeAsserted(): void { - $this->assertIsCallable(function (): void { + $this->assertIsCallable(static function (): void { }); try { @@ -2198,7 +2198,7 @@ public function testNotCallableTypeCanBeAsserted(): void $this->assertIsNotCallable(null); try { - $this->assertIsNotCallable(function (): void { + $this->assertIsNotCallable(static function (): void { }); } catch (AssertionFailedError $e) { return; diff --git a/tests/unit/Framework/Constraint/BinaryOperatorTestCase.php b/tests/unit/Framework/Constraint/BinaryOperatorTestCase.php index a6d302fb3bf..b6e6a867fe0 100644 --- a/tests/unit/Framework/Constraint/BinaryOperatorTestCase.php +++ b/tests/unit/Framework/Constraint/BinaryOperatorTestCase.php @@ -78,7 +78,7 @@ final public function testOperatorCount(): void 8, ]; - $constraints = array_map(function ($count) { + $constraints = array_map(static function ($count) { return CountConstraint::fromCount($count); }, $counts); @@ -154,7 +154,7 @@ final public function providerConnectiveTruthTable() */ final public function testEvaluateReturnsCorrectBooleanResult(array $inputs, bool $expected): void { - $constraints = array_map(function (bool $input) { + $constraints = array_map(static function (bool $input) { return BooleanConstraint::fromBool($input); }, $inputs); @@ -171,7 +171,7 @@ final public function testEvaluateReturnsCorrectBooleanResult(array $inputs, boo */ final public function testEvaluateReturnsNullOnSuccessAndThrowsExceptionOnFailure(array $inputs, bool $expected): void { - $constraints = array_map(function (bool $input) { + $constraints = array_map(static function (bool $input) { return BooleanConstraint::fromBool($input); }, $inputs); @@ -184,7 +184,7 @@ final public function testEvaluateReturnsNullOnSuccessAndThrowsExceptionOnFailur } else { $expectedString = self::operatorJoinStrings( array_map( - function (Constraint $operand) { + static function (Constraint $operand) { return $operand->toString(); }, $constraints @@ -222,7 +222,7 @@ public function providerToStringWithNamedConstraints(): array */ public function testToStringWithNamedConstraints(string ...$names): void { - $constraints = array_map(function (string $name) { + $constraints = array_map(static function (string $name) { return NamedConstraint::fromName($name); }, $names); @@ -571,7 +571,7 @@ final protected static function getBooleanTuples(int $minSize, int $maxSize): ar { $tuples = self::getBinaryTuples($minSize, $maxSize); - return array_map(function ($tuple) { + return array_map(static function ($tuple) { return array_map('boolval', $tuple); }, $tuples); } diff --git a/tests/unit/Framework/Constraint/CallbackTest.php b/tests/unit/Framework/Constraint/CallbackTest.php index 3add01293f7..0e100cee8c8 100644 --- a/tests/unit/Framework/Constraint/CallbackTest.php +++ b/tests/unit/Framework/Constraint/CallbackTest.php @@ -28,11 +28,11 @@ public function callbackReturningTrue() public function testConstraintCallback(): void { - $closureReflect = function ($parameter) { + $closureReflect = static function ($parameter) { return $parameter; }; - $closureWithoutParameter = function () { + $closureWithoutParameter = static function () { return true; }; @@ -56,7 +56,7 @@ public function testConstraintCallback(): void public function testConstraintCallbackFailure(): void { - $constraint = new Callback(function () { + $constraint = new Callback(static function () { return false; }); diff --git a/tests/unit/Framework/Constraint/IsInstanceOfTest.php b/tests/unit/Framework/Constraint/IsInstanceOfTest.php index 50039570c1c..a0d728ec697 100644 --- a/tests/unit/Framework/Constraint/IsInstanceOfTest.php +++ b/tests/unit/Framework/Constraint/IsInstanceOfTest.php @@ -23,7 +23,7 @@ public function testConstraintInstanceOf(): void { $constraint = new IsInstanceOf(stdClass::class); - self::assertTrue($constraint->evaluate(new stdClass, '', true)); + $this->assertTrue($constraint->evaluate(new stdClass, '', true)); } public function testConstraintFailsOnString(): void @@ -33,7 +33,7 @@ public function testConstraintFailsOnString(): void try { $constraint->evaluate('stdClass'); } catch (ExpectationFailedException $e) { - self::assertSame( + $this->assertSame( <<<'EOT' Failed asserting that 'stdClass' is an instance of class "stdClass". @@ -50,7 +50,7 @@ public function testCronstraintsThrowsReflectionException(): void $constraint = new IsInstanceOf(NotExistingClass::class); - self::assertSame( + $this->assertSame( 'is instance of class "PHPUnit\Framework\Constraint\NotExistingClass"', $constraint->toString() ); diff --git a/tests/unit/Framework/Constraint/JsonMatchesTest.php b/tests/unit/Framework/Constraint/JsonMatchesTest.php index 544b129dbb3..a8ce6d1704f 100644 --- a/tests/unit/Framework/Constraint/JsonMatchesTest.php +++ b/tests/unit/Framework/Constraint/JsonMatchesTest.php @@ -56,8 +56,8 @@ public static function evaluateThrowsExpectationFailedExceptionWhenJsonIsValidBu /** * @dataProvider evaluateDataprovider * - * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testEvaluate($expected, $jsonOther, $jsonValue): void { @@ -69,10 +69,10 @@ public function testEvaluate($expected, $jsonOther, $jsonValue): void /** * @dataProvider evaluateThrowsExpectationFailedExceptionWhenJsonIsValidButDoesNotMatchDataprovider * - * @throws ExpectationFailedException * @throws \PHPUnit\Framework\AssertionFailedError * @throws \PHPUnit\Framework\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function testEvaluateThrowsExpectationFailedExceptionWhenJsonIsValidButDoesNotMatch($jsonOther, $jsonValue): void { diff --git a/tests/unit/Framework/MockObject/GeneratorTest.php b/tests/unit/Framework/MockObject/GeneratorTest.php index 5f55edfb851..d1417be341d 100644 --- a/tests/unit/Framework/MockObject/GeneratorTest.php +++ b/tests/unit/Framework/MockObject/GeneratorTest.php @@ -31,14 +31,14 @@ /** * @covers \PHPUnit\Framework\MockObject\Generator * - * @uses \PHPUnit\Framework\MockObject\InvocationHandler * @uses \PHPUnit\Framework\MockObject\Builder\InvocationMocker * @uses \PHPUnit\Framework\MockObject\Invocation + * @uses \PHPUnit\Framework\MockObject\InvocationHandler * @uses \PHPUnit\Framework\MockObject\Matcher * @uses \PHPUnit\Framework\MockObject\Rule\InvocationOrder + * @uses \PHPUnit\Framework\MockObject\Rule\InvokedCount * @uses \PHPUnit\Framework\MockObject\Rule\MethodName * @uses \PHPUnit\Framework\MockObject\Stub\ReturnStub - * @uses \PHPUnit\Framework\MockObject\Rule\InvokedCount * * @small */ diff --git a/tests/unit/Framework/MockObject/MockObjectTest.php b/tests/unit/Framework/MockObject/MockObjectTest.php index 3d7612912a4..b1afa67d4d4 100644 --- a/tests/unit/Framework/MockObject/MockObjectTest.php +++ b/tests/unit/Framework/MockObject/MockObjectTest.php @@ -595,7 +595,7 @@ public function testObjectMethodCallWithArgumentCloningEnabled(): void $mock->method('doSomethingElse') ->will( $this->returnCallback( - function () use (&$actualArguments): void { + static function () use (&$actualArguments): void { $actualArguments = \func_get_args(); } ) @@ -622,7 +622,7 @@ public function testObjectMethodCallWithArgumentCloningDisabled(): void $mock->method('doSomethingElse') ->will( $this->returnCallback( - function () use (&$actualArguments): void { + static function () use (&$actualArguments): void { $actualArguments = \func_get_args(); } ) @@ -849,7 +849,7 @@ public function testMockArgumentsPassedByReference2(): void $foo->method('bar') ->will($this->returnCallback( - function (&$a, &$b, $c): void { + static function (&$a, &$b, $c): void { $b = 1; } )); @@ -1030,7 +1030,7 @@ public function testParameterCallbackConstraintOnlyEvaluatedOnce(): void $callCount = 0; $mock->expects($this->exactly($expectedNumberOfCalls))->method('bar') - ->with($this->callback(function ($argument) use (&$callCount) { + ->with($this->callback(static function ($argument) use (&$callCount) { return $argument === 'call_' . $callCount++; })); diff --git a/tests/unit/Framework/TestCaseTest.php b/tests/unit/Framework/TestCaseTest.php index 65381396afd..6ac380614ef 100644 --- a/tests/unit/Framework/TestCaseTest.php +++ b/tests/unit/Framework/TestCaseTest.php @@ -1102,7 +1102,7 @@ public function testCanUseDependsToDependOnSuccessfulClass(): void $this->assertArrayHasKey(DependencyOnClassTest::class . '::testThatDependsOnASuccessfulClass', $result->passed()); // Confirm the test depending on the failing TestSuite::class has been warn-skipped - $skipped = array_map(function (TestFailure $t) { + $skipped = array_map(static function (TestFailure $t) { return $t->getTestName(); }, $result->skipped()); $this->assertContains(DependencyOnClassTest::class . '::testThatDependsOnAFailingClass', $skipped); diff --git a/tests/unit/Util/Annotation/RegistryTest.php b/tests/unit/Util/Annotation/RegistryTest.php index f56e7eded0f..8ff8b438665 100644 --- a/tests/unit/Util/Annotation/RegistryTest.php +++ b/tests/unit/Util/Annotation/RegistryTest.php @@ -27,7 +27,7 @@ public function testRegistryLookupWithExistingClassAnnotation(): void { $annotation = Registry::getInstance()->forClassName(self::class); - self::assertSame( + $this->assertSame( [ 'small' => [''], 'covers' => ['\PHPUnit\Util\Annotation\Registry'], @@ -36,7 +36,7 @@ public function testRegistryLookupWithExistingClassAnnotation(): void $annotation->symbolAnnotations() ); - self::assertSame( + $this->assertSame( $annotation, Registry::getInstance()->forClassName(self::class), 'Registry memoizes retrieved DocBlock instances' @@ -50,7 +50,7 @@ public function testRegistryLookupWithExistingMethodAnnotation(): void 'testTicketAnnotationSupportsNumericValue' ); - self::assertSame( + $this->assertSame( [ 'testdox' => ['Empty test for @ticket numeric annotation values'], 'ticket' => ['3502'], @@ -60,7 +60,7 @@ public function testRegistryLookupWithExistingMethodAnnotation(): void $annotation->symbolAnnotations() ); - self::assertSame( + $this->assertSame( $annotation, Registry::getInstance()->forMethod( NumericGroupAnnotationTest::class, diff --git a/tests/unit/Util/RegularExpressionTest.php b/tests/unit/Util/RegularExpressionTest.php index 8e41f33d261..2b0121645c7 100644 --- a/tests/unit/Util/RegularExpressionTest.php +++ b/tests/unit/Util/RegularExpressionTest.php @@ -40,8 +40,8 @@ public function invalidRegexpProvider(): array * @testdox Valid regex $pattern on $subject returns $return * @dataProvider validRegexpProvider * - * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException + * @throws Exception */ public function testValidRegex($pattern, $subject, $return): void { @@ -52,8 +52,8 @@ public function testValidRegex($pattern, $subject, $return): void * @testdox Invalid regex $pattern on $subject * @dataProvider invalidRegexpProvider * - * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException + * @throws Exception */ public function testInvalidRegex($pattern, $subject): void { diff --git a/tests/unit/Util/TestClassTest.php b/tests/unit/Util/TestClassTest.php index 7e37b91e74f..6250e6c5c93 100644 --- a/tests/unit/Util/TestClassTest.php +++ b/tests/unit/Util/TestClassTest.php @@ -82,9 +82,9 @@ final class TestClassTest extends TestCase * @testdox Test::getRequirements() for $test * @dataProvider requirementsProvider * - * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Warning */ public function testGetRequirements($test, $result): void { @@ -528,10 +528,10 @@ public function requirementsProvider(): array * @testdox Test::getRequirements() with constraints for $test * @dataProvider requirementsWithVersionConstraintsProvider * - * @throws Exception - * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception + * @throws Warning */ public function testGetRequirementsWithVersionConstraints($test, array $result): void { @@ -720,9 +720,9 @@ public function testGetRequirementsMergesClassAndMethodDocBlocks(): void * @testdox Test::getMissingRequirements() for $test * @dataProvider missingRequirementsProvider * - * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Warning */ public function testGetMissingRequirements($test, $result): void { @@ -1224,9 +1224,9 @@ public function methodForTestParseAnnotationThatIsOnlyOneLine(): void /** * @dataProvider getLinesToBeCoveredProvider * - * @throws CodeCoverageException * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws CodeCoverageException */ public function testGetLinesToBeCovered($test, $lines): void { @@ -1559,7 +1559,7 @@ public function canSkipCoverageProvider(): array */ public function testGetGroupsFromAuthorAndTicketAnnotations(string $class, string $method, array $groups): void { - self::assertSame($groups, Test::getGroups($class, $method)); + $this->assertSame($groups, Test::getGroups($class, $method)); } public function getGroupsProvider(): array diff --git a/tests/unit/Util/Xml/ValidatorTest.php b/tests/unit/Util/Xml/ValidatorTest.php index cc6cc72b45d..2787b4cea04 100644 --- a/tests/unit/Util/Xml/ValidatorTest.php +++ b/tests/unit/Util/Xml/ValidatorTest.php @@ -16,8 +16,8 @@ /** * @small * - * @covers \PHPUnit\Util\Xml\Validator * @covers \PHPUnit\Util\Xml\ValidationResult + * @covers \PHPUnit\Util\Xml\Validator */ final class ValidatorTest extends TestCase {