Skip to content

Commit

Permalink
Merge branch '9.6' into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 19, 2023
2 parents 814e9f1 + b92dfee commit 0240350
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'const' => 'none',
'method' => 'one',
'property' => 'only_if_meta'
]
Expand Down
3 changes: 1 addition & 2 deletions src/Metadata/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
*/
abstract class Metadata
{
private const CLASS_LEVEL = 0;

private const CLASS_LEVEL = 0;
private const METHOD_LEVEL = 1;
private readonly int $level;

Expand Down
12 changes: 4 additions & 8 deletions src/Metadata/Parser/Annotation/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@
*/
final class DocBlock
{
private const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m';

private const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m';
private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<constraint>[\d\t \-.|~^]+)[ \t]*\r?$/m';

private const REGEX_REQUIRES_OS = '/@requires\s+(?P<name>OS(?:FAMILY)?)\s+(?P<value>.+?)[ \t]*\r?$/m';

private const REGEX_REQUIRES_SETTING = '/@requires\s+(?P<name>setting)\s+(?P<setting>([^ ]+?))\s*(?P<value>[\w\.-]+[\w\.]?)?[ \t]*\r?$/m';

private const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^\s<>=!]+))\s*(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+[\d\.]?)?[ \t]*\r?$/m';
private const REGEX_REQUIRES_OS = '/@requires\s+(?P<name>OS(?:FAMILY)?)\s+(?P<value>.+?)[ \t]*\r?$/m';
private const REGEX_REQUIRES_SETTING = '/@requires\s+(?P<name>setting)\s+(?P<setting>([^ ]+?))\s*(?P<value>[\w\.-]+[\w\.]?)?[ \t]*\r?$/m';
private const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^\s<>=!]+))\s*(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+[\d\.]?)?[ \t]*\r?$/m';
private readonly string $docComment;

/**
Expand Down
9 changes: 3 additions & 6 deletions src/TextUI/Command/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
*/
final class Result
{
public const SUCCESS = 0;

public const FAILURE = 1;

public const SUCCESS = 0;
public const FAILURE = 1;
public const EXCEPTION = 2;

public const CRASH = 255;
public const CRASH = 255;
private readonly string $output;
private readonly int $shellExitCode;

Expand Down
1 change: 0 additions & 1 deletion src/TextUI/Configuration/Cli/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ final class Builder
'log-events-verbose-text=',
'version',
];

private const SHORT_OPTIONS = 'd:c:hv';

/**
Expand Down
9 changes: 3 additions & 6 deletions src/TextUI/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
*/
final class Configuration
{
public const COLOR_NEVER = 'never';

public const COLOR_AUTO = 'auto';

public const COLOR_ALWAYS = 'always';

public const COLOR_NEVER = 'never';
public const COLOR_AUTO = 'auto';
public const COLOR_ALWAYS = 'always';
public const COLOR_DEFAULT = self::COLOR_NEVER;
private readonly ?string $cliArgument;
private readonly ?string $configurationFile;
Expand Down
3 changes: 1 addition & 2 deletions src/TextUI/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
final class Help
{
private const LEFT_MARGIN = ' ';

private const HELP_TEXT = [
private const HELP_TEXT = [
'Usage' => [
['text' => 'phpunit [options] UnitTest.php'],
['text' => 'phpunit [options] <directory>'],
Expand Down
6 changes: 2 additions & 4 deletions src/TextUI/ShellExitCodeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
*/
final class ShellExitCodeCalculator
{
private const SUCCESS_EXIT = 0;

private const FAILURE_EXIT = 1;

private const SUCCESS_EXIT = 0;
private const FAILURE_EXIT = 1;
private const EXCEPTION_EXIT = 2;

public function calculate(bool $failOnEmptyTestSuite, bool $failOnRisky, bool $failOnWarning, bool $failOnIncomplete, bool $failOnSkipped, TestResult $result): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
*/
final class SeparateClassRunMethodInNewProcessTest extends TestCase
{
public const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt';

public const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt';
public const INITIAL_PARENT_PROCESS_ID = 0;

public const INITIAL_PROCESS_ID = 1;
public static $parentProcessId = self::INITIAL_PARENT_PROCESS_ID;
public static $processId = self::INITIAL_PROCESS_ID;
public const INITIAL_PROCESS_ID = 1;
public static $parentProcessId = self::INITIAL_PARENT_PROCESS_ID;
public static $processId = self::INITIAL_PROCESS_ID;

public static function setUpBeforeClass(): void
{
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/Runner/TestSuiteSorterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,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',
Expand Down

0 comments on commit 0240350

Please sign in to comment.