Skip to content

Commit 42ae667

Browse files
committed
Fix codingstyle.
1 parent 94954e8 commit 42ae667

File tree

5 files changed

+19
-32
lines changed

5 files changed

+19
-32
lines changed

spec/CodeCoverageExtensionSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace spec\FriendsOfPhpSpec\PhpSpec\CodeCoverage;
66

7+
use Exception;
78
use FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension;
89
use PhpSpec\ObjectBehavior;
910
use PhpSpec\ServiceContainer\IndexedServiceContainer;

src/CodeCoverageExtension.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public function load(ServiceContainer $container, array $params = []): void
5353
try {
5454
$coverage = new CodeCoverage(null, $container->get('code_coverage.filter'));
5555
} catch (RuntimeException $error) {
56-
throw new NoCoverageDriverAvailableException('There is no available coverage driver to be used.', 0, $error);
56+
throw new NoCoverageDriverAvailableException(
57+
'There is no available coverage driver to be used.',
58+
0,
59+
$error
60+
);
5761
}
5862

5963
return $coverage;
@@ -68,9 +72,11 @@ public function load(ServiceContainer $container, array $params = []): void
6872
$options['format'] = (array) $options['format'];
6973
}
7074

71-
if (isset($options['output']) && !is_array($options['output']) && 1 === count($options['format'])) {
72-
$format = $options['format'][0];
73-
$options['output'] = [$format => $options['output']];
75+
if (isset($options['output'])) {
76+
if (!is_array($options['output']) && 1 === count($options['format'])) {
77+
$format = $options['format'][0];
78+
$options['output'] = [$format => $options['output']];
79+
}
7480
}
7581

7682
if (!isset($options['show_uncovered_files'])) {

src/Exception/NoCoverageDriverAvailableException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of the friends-of-phpspec/phpspec-code-coverage.
75
*
@@ -12,6 +10,8 @@
1210
* that was distributed with this source code.
1311
*/
1412

13+
declare(strict_types=1);
14+
1515
namespace FriendsOfPhpSpec\PhpSpec\CodeCoverage\Exception;
1616

1717
use RuntimeException;

src/Listener/CodeCoverageListener.php

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of the friends-of-phpspec/phpspec-code-coverage package.
75
*
@@ -12,6 +10,8 @@
1210
* that was distributed with this source code.
1311
*/
1412

13+
declare(strict_types=1);
14+
1515
namespace FriendsOfPhpSpec\PhpSpec\CodeCoverage\Listener;
1616

1717
use PhpSpec\Console\ConsoleIO;
@@ -34,18 +34,9 @@ class CodeCoverageListener implements EventSubscriberInterface
3434

3535
private $reports;
3636

37-
/**
38-
* @var bool
39-
*/
4037
private $skipCoverage;
4138

42-
/**
43-
* @param ConsoleIO $io
44-
* @param CodeCoverage $coverage
45-
* @param array $reports
46-
* @param bool $skipCoverage
47-
*/
48-
public function __construct(ConsoleIO $io, CodeCoverage $coverage, array $reports, $skipCoverage = false)
39+
public function __construct(ConsoleIO $io, CodeCoverage $coverage, array $reports, bool $skipCoverage = false)
4940
{
5041
$this->io = $io;
5142
$this->coverage = $coverage;
@@ -62,9 +53,6 @@ public function __construct(ConsoleIO $io, CodeCoverage $coverage, array $report
6253
$this->skipCoverage = $skipCoverage;
6354
}
6455

65-
/**
66-
* @param ExampleEvent $event
67-
*/
6856
public function afterExample(ExampleEvent $event): void
6957
{
7058
if ($this->skipCoverage) {
@@ -74,9 +62,6 @@ public function afterExample(ExampleEvent $event): void
7462
$this->coverage->stop();
7563
}
7664

77-
/**
78-
* @param SuiteEvent $event
79-
*/
8065
public function afterSuite(SuiteEvent $event): void
8166
{
8267
if ($this->skipCoverage) {
@@ -106,9 +91,6 @@ public function afterSuite(SuiteEvent $event): void
10691
}
10792
}
10893

109-
/**
110-
* @param ExampleEvent $event
111-
*/
11294
public function beforeExample(ExampleEvent $event): void
11395
{
11496
if ($this->skipCoverage) {
@@ -175,9 +157,6 @@ public static function getSubscribedEvents(): array
175157
];
176158
}
177159

178-
/**
179-
* @param array $options
180-
*/
181160
public function setOptions(array $options): void
182161
{
183162
$this->options = $options + $this->options;

src/bootstrap.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of the friends-of-phpspec/phpspec-code-coverage package.
75
*
@@ -11,6 +9,9 @@
119
* For the full copyright and license information, please see the LICENSE file
1210
* that was distributed with this source code.
1311
*/
12+
13+
declare(strict_types=1);
14+
1415
use FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension;
1516

1617
class_alias(

0 commit comments

Comments
 (0)