Skip to content

Commit e53db5d

Browse files
committed
Update coding standard
1 parent 7ec658b commit e53db5d

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
-
4545
name: "Run friendsofphp/php-cs-fixer"
46-
run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose"
46+
run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose --allow-risky=yes"
4747
phpstan:
4848
name: "PHPStan (${{ matrix.php-version }})"
4949

.php_cs.dist

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $finder = PhpCsFixer\Finder::create()
44
->in('lib')
55
->in('tests')
66
->exclude([
7-
'tests/Workspace'
7+
'tests/Workspace',
88
])
99
;
1010

@@ -13,6 +13,11 @@ return PhpCsFixer\Config::create()
1313
'@PSR2' => true,
1414
'no_unused_imports' => true,
1515
'array_syntax' => ['syntax' => 'short'],
16+
'void_return' => true,
17+
'ordered_class_elements' => true,
18+
'single_quote' => true,
19+
'heredoc_indentation' => true,
20+
'global_namespace_import' => true,
1621
])
1722
->setFinder($finder)
1823
;

tests/Integration/WorkspaceTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ protected function setUp(): void
1313
$this->workspace->reset();
1414
}
1515

16-
public function testBuild()
16+
public function testBuild(): void
1717
{
1818
$manifest = <<<'EOT'
19-
// File: Foobar.php
20-
<?php
21-
22-
class Foobar
23-
{
24-
}
25-
// File: Foobar/Barfoo.php
26-
<?php
27-
28-
namespace Foobar;
29-
30-
class Barfoo
31-
{
32-
}
33-
// File: Expected.php
34-
Hello World
35-
EOT
19+
// File: Foobar.php
20+
<?php
21+
22+
class Foobar
23+
{
24+
}
25+
// File: Foobar/Barfoo.php
26+
<?php
27+
28+
namespace Foobar;
29+
30+
class Barfoo
31+
{
32+
}
33+
// File: Expected.php
34+
Hello World
35+
EOT
3636
;
3737

3838
$this->workspace->loadManifest($manifest);
@@ -43,15 +43,15 @@ class Barfoo
4343
$this->assertEquals('Hello World', $this->workspace->getContents('Expected.php'));
4444
}
4545

46-
public function testGetContentsNotExist()
46+
public function testGetContentsNotExist(): void
4747
{
4848
$this->expectException(InvalidArgumentException::class);
4949
$this->expectExceptionMessage('File "barbarbarbar" does not exist');
5050

5151
$this->workspace->getContents('barbarbarbar');
5252
}
5353

54-
public function testReset()
54+
public function testReset(): void
5555
{
5656
$this->workspace->reset();
5757
touch($this->workspace->path('Foobar.php'));
@@ -67,31 +67,31 @@ public function testReset()
6767
$this->assertFalse($this->workspace->exists('Barfoo/Bazboo.php'));
6868
}
6969

70-
public function testMkdir()
70+
public function testMkdir(): void
7171
{
7272
$this->workspace->mkdir('foobar');
7373
$this->assertTrue($this->workspace->exists('foobar'));
7474
$this->assertFalse($this->workspace->exists('barfoo'));
7575
}
7676

77-
public function testPutFileContents()
77+
public function testPutFileContents(): void
7878
{
7979
$this->workspace->put('foobar', 'foobar contents');
8080
$this->assertTrue($this->workspace->exists('foobar'));
8181
$this->assertStringContainsString('foobar contents', $this->workspace->getContents('foobar'));
8282
}
8383

84-
public function testGetPathWithNoArgs()
84+
public function testGetPathWithNoArgs(): void
8585
{
8686
$this->assertEquals($this->workspaceDir(), $this->workspace->path());
8787
}
8888

89-
public function testGetPath()
89+
public function testGetPath(): void
9090
{
9191
$this->assertEquals($this->workspaceDir() . '/foo', $this->workspace->path('foo'));
9292
}
9393

94-
public function testGetPathConcat()
94+
public function testGetPathConcat(): void
9595
{
9696
$workspace = Workspace::create($this->workspaceDir() . '/foobar/');
9797
$this->assertEquals($this->workspaceDir() . '/foobar/foo', $workspace->path('foo'));

0 commit comments

Comments
 (0)