Skip to content

Commit 9c2859d

Browse files
committed
fix CS
1 parent aed7d42 commit 9c2859d

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

examples/bootstrap.monolog.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct($name = 'PHPUnit', $level = 'debug')
2020
* - summary of test suites (message "Results OK ...", or "Results KO ..."
2121
*/
2222
$filters = array(
23-
function($record, $handlerLevel) {
23+
function ($record, $handlerLevel) {
2424
if ($record['level'] > $handlerLevel) {
2525
return true;
2626
}
@@ -43,7 +43,6 @@ function($record, $handlerLevel) {
4343
$growl = new GrowlHandler(array(), Logger::NOTICE);
4444

4545
$handlers[] = new CallbackFilterHandler($growl, $filters);
46-
4746
} catch (Exception $e) {
4847
// Growl server is probably not started
4948
echo $e->getMessage(), PHP_EOL, PHP_EOL;

examples/bootstrap.printer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ private function parseCliArguments(): array
5252
$parameters = $_SERVER['argv'];
5353
$shortOptions = 'd:c:hv';
5454
if (version_compare(Version::id(), '9.3.8', 'ge')) {
55-
return (new CliParser)->parse($parameters, $shortOptions);
55+
return (new CliParser())->parse($parameters, $shortOptions);
5656
}
5757
if (version_compare(Version::id(), '8.5.9', 'ge')) {
5858
// @see https://github.com/sebastianbergmann/phpunit/commit/d5d1ee19a5f04a022ae1dd00590ccf60ec269b16
59-
return GetOptUtil::parse($parameters, $shortOptions);
59+
return GetOptUtil::parse($parameters, $shortOptions); /** @phpstan-ignore-line */
6060
}
61-
return GetOptUtil::getopt($parameters, $shortOptions);
61+
return GetOptUtil::getopt($parameters, $shortOptions); /** @phpstan-ignore-line */
6262
}
6363
}
6464

examples/bootstrap.psr3.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ public function format(array $record)
2424
$vars['message'] = $this->interpolate($record['message'], $record['context']);
2525

2626
foreach ($vars as $var => $val) {
27-
if (false !== strpos($output, '%'.$var.'%')) {
27+
if (false !== strpos($output, '%' . $var . '%')) {
2828
if ($val instanceof \DateTime) {
2929
$val = $val->format("Y-m-d H:i:s");
3030
}
31-
$output = str_replace('%'.$var.'%', $val, $output);
31+
$output = str_replace('%' . $var . '%', $val, $output);
3232
}
3333
}
3434

examples/testSuite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class YourTestSuite extends TestCase
99
public function testIncomplete()
1010
{
1111
// Optional: Test anything here, if you want.
12-
$this->assertTrue(TRUE, 'This should already work.');
12+
$this->assertTrue(true, 'This should already work.');
1313

1414
// Stop here and mark this test as incomplete.
1515
$this->markTestIncomplete(
16-
'This test has not been implemented yet.'
16+
'This test has not been implemented yet.'
1717
);
1818
}
1919

@@ -33,7 +33,7 @@ public function testFailure()
3333

3434
public function testPass()
3535
{
36-
$this->assertTrue(TRUE, 'This should always work.');
36+
$this->assertTrue(true, 'This should always work.');
3737
}
3838

3939
/**

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ parameters:
22
level: 1
33
paths:
44
- src/
5+
bootstrapFiles:
6+
- examples/bootstrap.monolog.php
7+
- examples/bootstrap.printer.php
8+
- examples/bootstrap.psr3.php

src/LoggerTestListenerTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public function getStats(): array
368368
* @param TestResult $result
369369
* @return void
370370
*/
371-
public function printFooter(TestResult $result) : void
371+
public function printFooter(TestResult $result): void
372372
{
373373
$testCount = $result->count();
374374
$assertionCount = $this->numAssertions;
@@ -424,8 +424,7 @@ protected function formatCounters(
424424
int $incompleteCount,
425425
int $skipCount,
426426
int $riskyCount
427-
) : string
428-
{
427+
): string {
429428
$resultMessage = "Tests: $testCount, ";
430429
$resultMessage .= "Assertions: $assertionCount";
431430

0 commit comments

Comments
 (0)