Skip to content

Commit 6c7cf7d

Browse files
committed
Update coding style and standard.
1 parent 65ba78c commit 6c7cf7d

File tree

6 files changed

+311
-277
lines changed

6 files changed

+311
-277
lines changed

spec/CodeCoverageExtensionSpec.php

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,58 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace spec\LeanPHP\PhpSpec\CodeCoverage;
46

7+
use LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension;
58
use PhpSpec\ObjectBehavior;
69
use PhpSpec\ServiceContainer\IndexedServiceContainer;
7-
use Prophecy\Argument;
8-
use LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension;
910

1011
/**
1112
* @author Henrik Bjornskov
1213
*/
1314
class CodeCoverageExtensionSpec extends ObjectBehavior
1415
{
15-
function it_is_initializable()
16+
public function it_is_initializable(): void
1617
{
1718
$this->shouldHaveType(CodeCoverageExtension::class);
1819
}
1920

20-
function it_should_use_html_format_by_default()
21+
public function it_should_transform_format_into_array(): void
2122
{
22-
$container = new IndexedServiceContainer;
23-
$this->load($container, []);
23+
$container = new IndexedServiceContainer();
24+
$container->setParam('code_coverage', ['format' => 'html']);
25+
$this->load($container);
2426

2527
$options = $container->get('code_coverage.options');
28+
2629
if ($options['format'] !== ['html']) {
27-
throw new Exception("Default format is not html");
30+
throw new Exception('Default format is not transformed to an array');
2831
}
2932
}
3033

31-
function it_should_transform_format_into_array()
34+
public function it_should_use_html_format_by_default(): void
3235
{
33-
$container = new IndexedServiceContainer;
34-
$container->setParam('code_coverage', array('format' => 'html'));
35-
$this->load($container);
36+
$container = new IndexedServiceContainer();
37+
$this->load($container, []);
3638

3739
$options = $container->get('code_coverage.options');
40+
3841
if ($options['format'] !== ['html']) {
39-
throw new Exception("Default format is not transformed to an array");
42+
throw new Exception('Default format is not html');
4043
}
41-
4244
}
4345

44-
function it_should_use_singular_output()
46+
public function it_should_use_singular_output(): void
4547
{
46-
$container = new IndexedServiceContainer;
47-
$container->setParam('code_coverage', array('output' => 'test', 'format' => 'foo'));
48+
$container = new IndexedServiceContainer();
49+
$container->setParam('code_coverage', ['output' => 'test', 'format' => 'foo']);
4850
$this->load($container);
4951

5052
$options = $container->get('code_coverage.options');
51-
if ($options['output'] !== ['foo' => 'test']) {
52-
throw new Exception("Default format is not singular output");
53+
54+
if (['foo' => 'test'] !== $options['output']) {
55+
throw new Exception('Default format is not singular output');
5356
}
5457
}
5558
}

spec/Exception/NoCoverageDriverAvailableExceptionSpec.php

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

3+
declare(strict_types=1);
4+
35
namespace spec\LeanPHP\PhpSpec\CodeCoverage\Exception;
46

5-
use PhpSpec\ObjectBehavior;
67
use LeanPHP\PhpSpec\CodeCoverage\Exception\NoCoverageDriverAvailableException;
8+
use PhpSpec\ObjectBehavior;
79

810
/**
911
* @author Stéphane Hulard
1012
*/
1113
class NoCoverageDriverAvailableExceptionSpec extends ObjectBehavior
1214
{
13-
function it_is_initializable()
15+
public function it_is_initializable(): void
1416
{
1517
$this->shouldBeAnInstanceOf(\RuntimeException::class);
1618
$this->shouldHaveType(NoCoverageDriverAvailableException::class);

0 commit comments

Comments
 (0)