Skip to content

Commit

Permalink
Fix: Run 'php-cs-fixer fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and sebastianbergmann committed Jul 3, 2020
1 parent 72ac7dd commit 855eb2c
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ public function run(TestResult $result = null): TestResult
}
}
} catch (\Throwable $t) {
$message = "Exception in {$this->name}::${afterClassMethod}" . \PHP_EOL . $t->getMessage();
$message = "Exception in {$this->name}::{$afterClassMethod}" . \PHP_EOL . $t->getMessage();
$error = new SyntheticError($message, 0, $t->getFile(), $t->getLine(), $t->getTrace());

$placeholderTest = clone $test;
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/PhptTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ private function parse(): array
foreach ($unsupportedSections as $section) {
if (isset($sections[$section])) {
throw new Exception(
"PHPUnit does not support PHPT ${section} sections"
"PHPUnit does not support PHPT {$section} sections"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ private function handleOrderByOption(string $value): void
break;

default:
$this->exitWithErrorMessage("unrecognized --order-by option: ${order}");
$this->exitWithErrorMessage("unrecognized --order-by option: {$order}");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/TextUI/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function writeToConsole(): void
private function writePlaintext(): void
{
foreach (self::HELP_TEXT as $section => $options) {
print "${section}:" . \PHP_EOL;
print "{$section}:" . \PHP_EOL;

if ($section !== 'Usage') {
print \PHP_EOL;
Expand Down Expand Up @@ -210,7 +210,7 @@ private function writePlaintext(): void
private function writeWithColor(): void
{
foreach (self::HELP_TEXT as $section => $options) {
print Color::colorize('fg-yellow', "${section}:") . \PHP_EOL;
print Color::colorize('fg-yellow', "{$section}:") . \PHP_EOL;

foreach ($options as $option) {
if (isset($option['spacer'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function dim(string $buffer): string
return $buffer;
}

return "\e[2m${buffer}\e[22m";
return "\e[2m{$buffer}\e[22m";
}

public static function visualizeWhitespace(string $buffer, bool $visualizeEOL = false): string
Expand Down
12 changes: 6 additions & 6 deletions src/Util/Getopt.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static function parseShortOption(string $arg, string $short_options, arr

if ($arg[$i] === ':' || ($spec = \strstr($short_options, $opt)) === false) {
throw new Exception(
"unrecognized option -- ${opt}"
"unrecognized option -- {$opt}"
);
}

Expand All @@ -109,7 +109,7 @@ private static function parseShortOption(string $arg, string $short_options, arr
/* @noinspection ComparisonOperandsOrderInspection */
if (false === $opt_arg = \current($args)) {
throw new Exception(
"option requires an argument -- ${opt}"
"option requires an argument -- {$opt}"
);
}

Expand Down Expand Up @@ -148,7 +148,7 @@ private static function parseLongOption(string $arg, array $long_options, array

if ($opt_rest !== '' && $i + 1 < $count && $opt[0] !== '=' && \strpos($long_options[$i + 1], $opt) === 0) {
throw new Exception(
"option --${opt} is ambiguous"
"option --{$opt} is ambiguous"
);
}

Expand All @@ -158,15 +158,15 @@ private static function parseLongOption(string $arg, array $long_options, array
/* @noinspection ComparisonOperandsOrderInspection */
if (false === $opt_arg = \current($args)) {
throw new Exception(
"option --${opt} requires an argument"
"option --{$opt} requires an argument"
);
}

\next($args);
}
} elseif ($opt_arg) {
throw new Exception(
"option --${opt} doesn't allow an argument"
"option --{$opt} doesn't allow an argument"
);
}

Expand All @@ -176,6 +176,6 @@ private static function parseLongOption(string $arg, array $long_options, array
return;
}

throw new Exception("unrecognized option --${opt}");
throw new Exception("unrecognized option --{$opt}");
}
}
10 changes: 5 additions & 5 deletions src/Util/Log/TeamCity.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ public function startTestSuite(TestSuite $suite): void

if (\class_exists($suiteName, false)) {
$fileName = self::getFileName($suiteName);
$parameters['locationHint'] = "php_qn://${fileName}::\\${suiteName}";
$parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}";
} else {
$split = \explode('::', $suiteName);

if (\count($split) === 2 && \class_exists($split[0]) && \method_exists($split[0], $split[1])) {
$fileName = self::getFileName($split[0]);
$parameters['locationHint'] = "php_qn://${fileName}::\\${suiteName}";
$parameters['locationHint'] = "php_qn://{$fileName}::\\{$suiteName}";
$parameters['name'] = $split[1];
}
}
Expand Down Expand Up @@ -248,7 +248,7 @@ public function startTest(Test $test): void
if ($test instanceof TestCase) {
$className = \get_class($test);
$fileName = self::getFileName($className);
$params['locationHint'] = "php_qn://${fileName}::\\${className}::${testName}";
$params['locationHint'] = "php_qn://{$fileName}::\\{$className}::{$testName}";
}

$this->printEvent('testStarted', $params);
Expand Down Expand Up @@ -276,15 +276,15 @@ protected function writeProgress(string $progress): void

private function printEvent(string $eventName, array $params = []): void
{
$this->write("\n##teamcity[${eventName}");
$this->write("\n##teamcity[{$eventName}");

if ($this->flowId) {
$params['flowId'] = $this->flowId;
}

foreach ($params as $key => $value) {
$escapedValue = self::escapeValue((string) $value);
$this->write(" ${key}='${escapedValue}'");
$this->write(" {$key}='{$escapedValue}'");
}

$this->write("]\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Util/XdebugFilterScriptGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static function ($item) {
\\XDEBUG_FILTER_CODE_COVERAGE,
\\XDEBUG_PATH_WHITELIST,
[
${files}
{$files}
]
);
Expand Down
2 changes: 1 addition & 1 deletion tests/_files/ExceptionStackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testPrintingChildException(): void
} catch (ExpectationFailedException $e) {
$message = $e->getMessage() . $e->getComparisonFailure()->getDiff();

throw new PHPUnit\Framework\Exception("Child exception\n${message}", 101, $e);
throw new PHPUnit\Framework\Exception("Child exception\n{$message}", 101, $e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/cli/_files/MyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function __construct()

public function myHandler($value): void
{
print __METHOD__ . " ${value}\n";
print __METHOD__ . " {$value}\n";
}
}
2 changes: 1 addition & 1 deletion tests/unit/Framework/Assert/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testGlobalFunctionsFileContainsAllStaticAssertions(string $metho
Assert::assertContains(
$methodName,
self::$globalAssertionFunctions,
"Mapping for Assert::${methodName} is missing in Functions.php"
"Mapping for Assert::{$methodName} is missing in Functions.php"
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Framework/Constraint/DirectoryExistsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testEvaluateThrowsExpectationFailedExceptionWhenDirectoryDoesNot
} catch (ExpectationFailedException $e) {
$this->assertSame(
<<<PHP
Failed asserting that directory "${directory}" exists.
Failed asserting that directory "{$directory}" exists.
PHP
,
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/Framework/Constraint/IsEqualTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testConstraintIsEqual2($expected, $actual, $message): void
$constraint->evaluate($actual, 'custom message');
} catch (ExpectationFailedException $e) {
$this->assertEquals(
"custom message\n${message}",
"custom message\n{$message}",
$this->trimnl(TestFailure::exceptionToString($e))
);

Expand Down Expand Up @@ -297,17 +297,17 @@ public function isEqualProvider(): array
--- Expected
+++ Actual
@@ @@
-SplObjectStorage Object &${storage1hash} (
- '${ahash}' => Array &0 (
- 'obj' => stdClass Object &${ahash} (
-SplObjectStorage Object &{$storage1hash} (
- '{$ahash}' => Array &0 (
- 'obj' => stdClass Object &{$ahash} (
- 'foo' => 'bar'
- )
- 'inf' => null
- )
- '${bhash}' => Array &1 (
+SplObjectStorage Object &${storage2hash} (
+ '${bhash}' => Array &0 (
'obj' => stdClass Object &${bhash} ()
- '{$bhash}' => Array &1 (
+SplObjectStorage Object &{$storage2hash} (
+ '{$bhash}' => Array &0 (
'obj' => stdClass Object &{$bhash} ()
'inf' => null
)
)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Framework/Constraint/LogicalAndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testEvaluateThrowsExceptionIfAnyOfTheComposedConstraintsEvaluate
$toString = $this->stringify($constraints);

$expectedDescription = <<<EOF
Failed asserting that '${other}' ${toString}.
Failed asserting that '{$other}' {$toString}.
EOF;

Expand Down Expand Up @@ -159,8 +159,8 @@ public function testEvaluateThrowsExceptionWithCustomMessageIfAnyOfTheComposedCo
$toString = $this->stringify($constraints);

$expectedDescription = <<<EOF
${customDescription}
Failed asserting that '${other}' ${toString}.
{$customDescription}
Failed asserting that '{$other}' {$toString}.
EOF;

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Framework/Constraint/LogicalOrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function testEvaluateThrowsExceptionIfAllOfTheComposedConstraintsEvaluate
$toString = $this->stringify($constraints);

$expectedDescription = <<<EOF
Failed asserting that '${other}' ${toString}.
Failed asserting that '{$other}' {$toString}.
EOF;

Expand Down Expand Up @@ -152,8 +152,8 @@ public function testEvaluateThrowsExceptionWithCustomMessageIfAllOfTheComposedCo
$toString = $this->stringify($constraints);

$expectedDescription = <<<EOF
${customDescription}
Failed asserting that '${other}' ${toString}.
{$customDescription}
Failed asserting that '{$other}' {$toString}.
EOF;

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Framework/ConstraintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testConstraintFileNotExists(): void
} catch (ExpectationFailedException $e) {
$this->assertEquals(
<<<EOF
Failed asserting that file "${file}" does not exist.
Failed asserting that file "{$file}" does not exist.
EOF
,
Expand All @@ -116,7 +116,7 @@ public function testConstraintFileNotExists2(): void
$this->assertEquals(
<<<EOF
custom message
Failed asserting that file "${file}" does not exist.
Failed asserting that file "{$file}" does not exist.
EOF
,
Expand Down Expand Up @@ -1414,7 +1414,7 @@ public function testConstraintException(): void
$this->assertEquals(
<<<EOF
Failed asserting that exception of type "DummyException" matches expected exception "FoobarException". Message was: "Test" at
${stackTrace}.
{$stackTrace}.
EOF
,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Util/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testShouldUseDefaultValuesForInvalidIntegers(): void
public function testShouldParseXmlConfigurationRootAttributes(string $optionName, string $optionValue, $expected): void
{
$tmpFilename = \sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'phpunit.' . $optionName . \uniqid() . '.xml';
$xml = "<phpunit ${optionName}='${optionValue}'></phpunit>" . \PHP_EOL;
$xml = "<phpunit {$optionName}='{$optionValue}'></phpunit>" . \PHP_EOL;
\file_put_contents($tmpFilename, $xml);

$configurationInstance = Configuration::getInstance($tmpFilename);
Expand Down Expand Up @@ -448,7 +448,7 @@ public function testHandlePHPConfigurationDoesNotOverwriteVariablesFromPutEnv():
if ($backupFoo === false) {
\putenv('foo'); // delete variable from environment
} else {
\putenv("foo=${backupFoo}");
\putenv("foo={$backupFoo}");
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Util/XDebugFilterScriptGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function testReturnsExpectedScript(): void
\\XDEBUG_FILTER_CODE_COVERAGE,
\\XDEBUG_PATH_WHITELIST,
[
'${expectedDirectory}',
'${expectedDirectory}',
'${expectedDirectory}',
'{$expectedDirectory}',
'{$expectedDirectory}',
'{$expectedDirectory}',
'src/foo.php',
'src/bar.php'
]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testPrepareString(string $char): void
$e = null;

$escapedString = Xml::prepareString($char);
$xml = "<?xml version='1.0' encoding='UTF-8' ?><tag>${escapedString}</tag>";
$xml = "<?xml version='1.0' encoding='UTF-8' ?><tag>{$escapedString}</tag>";
$dom = new \DOMDocument('1.0', 'UTF-8');

try {
Expand Down

0 comments on commit 855eb2c

Please sign in to comment.