Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Commit 127bd38

Browse files
authored
Update coding standard (#7)
1 parent 0db5ed1 commit 127bd38

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
$finder = PhpCsFixer\Finder::create()
44
->in('lib')
55
->in('tests')
6+
->exclude([
7+
'Workspace',
8+
])
69
;
710

811
return PhpCsFixer\Config::create()
912
->setRules([
1013
'@PSR2' => true,
1114
'no_unused_imports' => true,
1215
'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,
1321
])
1422
->setFinder($finder)
1523
;
24+

lib/DebugExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DebugExtension implements Extension
1616
/**
1717
* {@inheritDoc}
1818
*/
19-
public function load(ContainerBuilder $container)
19+
public function load(ContainerBuilder $container): void
2020
{
2121
$container->register(ExtensionDocumentor::class, function (Container $container) {
2222
return new ExtensionDocumentor(
@@ -37,7 +37,7 @@ public function load(ContainerBuilder $container)
3737
/**
3838
* {@inheritDoc}
3939
*/
40-
public function configure(Resolver $schema)
40+
public function configure(Resolver $schema): void
4141
{
4242
}
4343
}

lib/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
'source' => new SourceContextProvider(),
1414
]);
1515

16-
VarDumper::setHandler(function ($var) use ($cloner, $dumper) {
16+
VarDumper::setHandler(function ($var) use ($cloner, $dumper): void {
1717
$dumper->dump($cloner->cloneVar($var));
1818
});

0 commit comments

Comments
 (0)