diff --git a/src/Framework/MockObject/Generator.php b/src/Framework/MockObject/Generator.php index 926a19335b6..2d31cf79015 100644 --- a/src/Framework/MockObject/Generator.php +++ b/src/Framework/MockObject/Generator.php @@ -74,7 +74,6 @@ public function __clone(): void } } EOT; - private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -86,7 +85,6 @@ public function __clone() } } EOT; - private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -100,7 +98,6 @@ public function __clone(): void } } EOT; - private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; diff --git a/src/TextUI/Help.php b/src/TextUI/Help.php index 2dd895604c8..1e885c87c4f 100644 --- a/src/TextUI/Help.php +++ b/src/TextUI/Help.php @@ -27,8 +27,7 @@ final class Help { private const LEFT_MARGIN = ' '; - - private const HELP_TEXT = [ + private const HELP_TEXT = [ 'Usage' => [ ['text' => 'phpunit [options] UnitTest [UnitTest.php]'], ['text' => 'phpunit [options] '], diff --git a/src/TextUI/ResultPrinter.php b/src/TextUI/ResultPrinter.php index 51b03309412..7a5a0ac5df2 100644 --- a/src/TextUI/ResultPrinter.php +++ b/src/TextUI/ResultPrinter.php @@ -47,23 +47,15 @@ */ class ResultPrinter extends Printer implements TestListener { - public const EVENT_TEST_START = 0; - - public const EVENT_TEST_END = 1; - + public const EVENT_TEST_START = 0; + public const EVENT_TEST_END = 1; public const EVENT_TESTSUITE_START = 2; - - public const EVENT_TESTSUITE_END = 3; - - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - - public const COLOR_DEFAULT = self::COLOR_NEVER; - - private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; + public const EVENT_TESTSUITE_END = 3; + public const COLOR_NEVER = 'never'; + public const COLOR_AUTO = 'auto'; + public const COLOR_ALWAYS = 'always'; + public const COLOR_DEFAULT = self::COLOR_NEVER; + private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; /** * @var int diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php index 70b1340b166..e14735c440c 100644 --- a/src/TextUI/TestRunner.php +++ b/src/TextUI/TestRunner.php @@ -84,10 +84,8 @@ */ final class TestRunner extends BaseTestRunner { - public const SUCCESS_EXIT = 0; - - public const FAILURE_EXIT = 1; - + public const SUCCESS_EXIT = 0; + public const FAILURE_EXIT = 1; public const EXCEPTION_EXIT = 2; /** diff --git a/src/Util/Annotation/DocBlock.php b/src/Util/Annotation/DocBlock.php index 84aad5f9c0a..c0865d854ef 100644 --- a/src/Util/Annotation/DocBlock.php +++ b/src/Util/Annotation/DocBlock.php @@ -72,19 +72,13 @@ final class DocBlock */ public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - + private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; - - private const REGEX_TEST_WITH = '/@testWith\s+/'; - - private const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'; + private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; + private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; + private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; + private const REGEX_TEST_WITH = '/@testWith\s+/'; + private const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'; /** @var string */ private $docComment; diff --git a/src/Util/TestDox/CliTestDoxPrinter.php b/src/Util/TestDox/CliTestDoxPrinter.php index 5c66211907f..becd5027b0b 100644 --- a/src/Util/TestDox/CliTestDoxPrinter.php +++ b/src/Util/TestDox/CliTestDoxPrinter.php @@ -65,7 +65,6 @@ class CliTestDoxPrinter extends TestDoxPrinter " \e[36m◑\e[0m running tests", " \e[36m◒\e[0m running tests", ]; - private const STATUS_STYLES = [ BaseTestRunner::STATUS_PASSED => [ 'symbol' => '✔', diff --git a/tests/end-to-end/regression/2724/SeparateClassRunMethodInNewProcessTest.php b/tests/end-to-end/regression/2724/SeparateClassRunMethodInNewProcessTest.php index 020e4217141..6ee6a715265 100644 --- a/tests/end-to-end/regression/2724/SeparateClassRunMethodInNewProcessTest.php +++ b/tests/end-to-end/regression/2724/SeparateClassRunMethodInNewProcessTest.php @@ -13,10 +13,8 @@ class SeparateClassRunMethodInNewProcessTest extends PHPUnit\Framework\TestCase { public const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt'; - - public const INITIAL_MASTER_PID = 0; - - public const INITIAL_PID1 = 1; + public const INITIAL_MASTER_PID = 0; + public const INITIAL_PID1 = 1; public static $masterPid = self::INITIAL_MASTER_PID; diff --git a/tests/unit/Runner/PhptTestCaseTest.php b/tests/unit/Runner/PhptTestCaseTest.php index a995382d020..bd88ce3a829 100644 --- a/tests/unit/Runner/PhptTestCaseTest.php +++ b/tests/unit/Runner/PhptTestCaseTest.php @@ -31,7 +31,6 @@ final class PhptTestCaseTest extends TestCase --EXPECT-- Hello PHPUnit! EOF; - private const EXPECTF_CONTENT = <<<'EOF' --TEST-- EXPECTF test @@ -40,7 +39,6 @@ final class PhptTestCaseTest extends TestCase --EXPECTF-- Hello %s! EOF; - private const EXPECTREGEX_CONTENT = <<<'EOF' --TEST-- EXPECTREGEX test @@ -49,7 +47,6 @@ final class PhptTestCaseTest extends TestCase --EXPECTREGEX-- Hello [HPU]{4}[nit]{3}! EOF; - private const FILE_SECTION = <<<'EOF' diff --git a/tests/unit/Runner/TestSuiteSorterTest.php b/tests/unit/Runner/TestSuiteSorterTest.php index e84d79fe5c9..f9a5673093e 100644 --- a/tests/unit/Runner/TestSuiteSorterTest.php +++ b/tests/unit/Runner/TestSuiteSorterTest.php @@ -31,8 +31,7 @@ final class TestSuiteSorterTest extends TestCase */ private const IGNORE_DEPENDENCIES = false; - private const RESOLVE_DEPENDENCIES = true; - + private const RESOLVE_DEPENDENCIES = true; private const MULTIDEPENDENCYTEST_EXECUTION_ORDER = [ MultiDependencyTest::class . '::testOne', MultiDependencyTest::class . '::testTwo',