diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 312b1c94..b30fc14d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: "Run friendsofphp/php-cs-fixer" - run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose" + run: "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose --allow-risky=yes" phpstan: name: "PHPStan (${{ matrix.php-version }})" diff --git a/.php_cs.dist b/.php_cs.dist index a3d5fa36..2820b890 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -4,7 +4,7 @@ $finder = PhpCsFixer\Finder::create() ->in('lib') ->in('tests') ->exclude([ - 'tests/Workspace' + 'tests/Workspace', ]) ; @@ -13,6 +13,11 @@ return PhpCsFixer\Config::create() '@PSR2' => true, 'no_unused_imports' => true, 'array_syntax' => ['syntax' => 'short'], + 'void_return' => true, + 'ordered_class_elements' => true, + 'single_quote' => true, + 'heredoc_indentation' => true, + 'global_namespace_import' => true, ]) ->setFinder($finder) ; diff --git a/tests/Integration/WorkspaceTest.php b/tests/Integration/WorkspaceTest.php index 818cc7eb..bdab2f75 100644 --- a/tests/Integration/WorkspaceTest.php +++ b/tests/Integration/WorkspaceTest.php @@ -13,26 +13,26 @@ protected function setUp(): void $this->workspace->reset(); } - public function testBuild() + public function testBuild(): void { $manifest = <<<'EOT' -// File: Foobar.php -workspace->loadManifest($manifest); @@ -43,7 +43,7 @@ class Barfoo $this->assertEquals('Hello World', $this->workspace->getContents('Expected.php')); } - public function testGetContentsNotExist() + public function testGetContentsNotExist(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('File "barbarbarbar" does not exist'); @@ -51,7 +51,7 @@ public function testGetContentsNotExist() $this->workspace->getContents('barbarbarbar'); } - public function testReset() + public function testReset(): void { $this->workspace->reset(); touch($this->workspace->path('Foobar.php')); @@ -67,31 +67,31 @@ public function testReset() $this->assertFalse($this->workspace->exists('Barfoo/Bazboo.php')); } - public function testMkdir() + public function testMkdir(): void { $this->workspace->mkdir('foobar'); $this->assertTrue($this->workspace->exists('foobar')); $this->assertFalse($this->workspace->exists('barfoo')); } - public function testPutFileContents() + public function testPutFileContents(): void { $this->workspace->put('foobar', 'foobar contents'); $this->assertTrue($this->workspace->exists('foobar')); $this->assertStringContainsString('foobar contents', $this->workspace->getContents('foobar')); } - public function testGetPathWithNoArgs() + public function testGetPathWithNoArgs(): void { $this->assertEquals($this->workspaceDir(), $this->workspace->path()); } - public function testGetPath() + public function testGetPath(): void { $this->assertEquals($this->workspaceDir() . '/foo', $this->workspace->path('foo')); } - public function testGetPathConcat() + public function testGetPathConcat(): void { $workspace = Workspace::create($this->workspaceDir() . '/foobar/'); $this->assertEquals($this->workspaceDir() . '/foobar/foo', $workspace->path('foo'));