From e19a9c83ca5af3efb41019e4770585a7f8984a2b Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Mon, 6 May 2019 09:54:00 +0200 Subject: [PATCH] Enable fixer for interface ordering --- .php_cs.dist | 4 ++++ src/Framework/MockObject/InvocationMocker.php | 2 +- src/Framework/TestCase.php | 2 +- src/Framework/TestSuite.php | 2 +- src/Runner/PhptTestCase.php | 2 +- src/Runner/ResultCacheExtension.php | 2 +- tests/end-to-end/_files/Extension.php | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index 283cbfba2ea..2a5d3e14a00 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -141,6 +141,10 @@ return PhpCsFixer\Config::create() ], ], 'ordered_imports' => true, + 'ordered_interfaces' => [ + 'direction' => 'ascend', + 'order' => 'alpha', + ], 'phpdoc_add_missing_param_annotation' => true, 'phpdoc_align' => true, 'phpdoc_annotation_without_dot' => true, diff --git a/src/Framework/MockObject/InvocationMocker.php b/src/Framework/MockObject/InvocationMocker.php index d93faaa434f..72e59b15414 100644 --- a/src/Framework/MockObject/InvocationMocker.php +++ b/src/Framework/MockObject/InvocationMocker.php @@ -25,7 +25,7 @@ * Keeps track of all expectations and stubs as well as registering * identifications for builders. */ -class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch +class InvocationMocker implements Invokable, MatcherCollection, NamespaceMatch { /** * @var MatcherInvocation[] diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index 9b55f2a9b33..0c73877dede 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -53,7 +53,7 @@ use Text_Template; use Throwable; -abstract class TestCase extends Assert implements Test, SelfDescribing +abstract class TestCase extends Assert implements SelfDescribing, Test { private const LOCALE_CATEGORIES = [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME]; diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php index 909cde85e39..77b84a70dbe 100644 --- a/src/Framework/TestSuite.php +++ b/src/Framework/TestSuite.php @@ -23,7 +23,7 @@ /** * A TestSuite is a composite of Tests. It runs a collection of test cases. */ -class TestSuite implements Test, SelfDescribing, IteratorAggregate +class TestSuite implements IteratorAggregate, SelfDescribing, Test { /** * Enable or disable the backup and restoration of the $GLOBALS array. diff --git a/src/Runner/PhptTestCase.php b/src/Runner/PhptTestCase.php index 57a58fb4f86..4163faa877c 100644 --- a/src/Runner/PhptTestCase.php +++ b/src/Runner/PhptTestCase.php @@ -24,7 +24,7 @@ /** * Runner for PHPT test cases. */ -class PhptTestCase implements Test, SelfDescribing +class PhptTestCase implements SelfDescribing, Test { /** * @var string[] diff --git a/src/Runner/ResultCacheExtension.php b/src/Runner/ResultCacheExtension.php index 962bbc07ef9..609164addda 100644 --- a/src/Runner/ResultCacheExtension.php +++ b/src/Runner/ResultCacheExtension.php @@ -9,7 +9,7 @@ */ namespace PHPUnit\Runner; -final class ResultCacheExtension implements AfterSuccessfulTestHook, AfterSkippedTestHook, AfterRiskyTestHook, AfterIncompleteTestHook, AfterTestErrorHook, AfterTestWarningHook, AfterTestFailureHook, AfterLastTestHook +final class ResultCacheExtension implements AfterIncompleteTestHook, AfterLastTestHook, AfterRiskyTestHook, AfterSkippedTestHook, AfterSuccessfulTestHook, AfterTestErrorHook, AfterTestFailureHook, AfterTestWarningHook { /** * @var TestResultCacheInterface diff --git a/tests/end-to-end/_files/Extension.php b/tests/end-to-end/_files/Extension.php index 9b215d6eddd..5a94378ceb7 100644 --- a/tests/end-to-end/_files/Extension.php +++ b/tests/end-to-end/_files/Extension.php @@ -21,7 +21,7 @@ use PHPUnit\Runner\BeforeFirstTestHook; use PHPUnit\Runner\BeforeTestHook; -final class Extension implements BeforeFirstTestHook, BeforeTestHook, AfterTestHook, AfterSuccessfulTestHook, AfterSkippedTestHook, AfterRiskyTestHook, AfterIncompleteTestHook, AfterTestErrorHook, AfterTestWarningHook, AfterTestFailureHook, AfterLastTestHook +final class Extension implements AfterIncompleteTestHook, AfterLastTestHook, AfterRiskyTestHook, AfterSkippedTestHook, AfterSuccessfulTestHook, AfterTestErrorHook, AfterTestFailureHook, AfterTestHook, AfterTestWarningHook, BeforeFirstTestHook, BeforeTestHook { private $amountOfInjectedArguments = 0;