Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 19, 2023
1 parent 1c365cf commit c61908f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 47 deletions.
3 changes: 0 additions & 3 deletions src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public function __clone(): void
}
}
EOT;

private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
Expand All @@ -86,7 +85,6 @@ public function __clone()
}
}
EOT;

private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
Expand All @@ -100,7 +98,6 @@ public function __clone(): void
}
}
EOT;

private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT'
namespace PHPUnit\Framework\MockObject;
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 [UnitTest.php]'],
['text' => 'phpunit [options] <directory>'],
Expand Down
24 changes: 8 additions & 16 deletions src/TextUI/ResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
18 changes: 6 additions & 12 deletions src/Util/Annotation/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+(?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_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+(?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_TEST_WITH = '/@testWith\s+/';
private const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m';

/** @var string */
private $docComment;
Expand Down
1 change: 0 additions & 1 deletion src/Util/TestDox/CliTestDoxPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '✔',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Runner/PhptTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ final class PhptTestCaseTest extends TestCase
--EXPECT--
Hello PHPUnit!
EOF;

private const EXPECTF_CONTENT = <<<'EOF'
--TEST--
EXPECTF test
Expand All @@ -40,7 +39,6 @@ final class PhptTestCaseTest extends TestCase
--EXPECTF--
Hello %s!
EOF;

private const EXPECTREGEX_CONTENT = <<<'EOF'
--TEST--
EXPECTREGEX test
Expand All @@ -49,7 +47,6 @@ final class PhptTestCaseTest extends TestCase
--EXPECTREGEX--
Hello [HPU]{4}[nit]{3}!
EOF;

private const FILE_SECTION = <<<'EOF'
<?php echo "Hello PHPUnit!"; ?>
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 @@ -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',
Expand Down

0 comments on commit c61908f

Please sign in to comment.