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

Commit b32b66b

Browse files
authored
Update coding standard (#11)
1 parent a13b07f commit b32b66b

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Diff for: .github/workflows/ci.yml

+1-1
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

Diff for: .php_cs.dist

+6-1
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+
'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
;

Diff for: lib/CompletionExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CompletionExtension implements Extension
3535
/**
3636
* {@inheritDoc}
3737
*/
38-
public function configure(Resolver $schema)
38+
public function configure(Resolver $schema): void
3939
{
4040
$schema->setDefaults([
4141
self::PARAM_DEDUPE => true,
@@ -52,7 +52,7 @@ public function configure(Resolver $schema)
5252
/**
5353
* {@inheritDoc}
5454
*/
55-
public function load(ContainerBuilder $container)
55+
public function load(ContainerBuilder $container): void
5656
{
5757
$this->registerCompletion($container);
5858
}

Diff for: tests/Unit/CompletionExtensionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function setUp(): void
4646
$this->formatter1 = $this->prophesize(Formatter::class);
4747
}
4848

49-
public function testCreatesChainedCompletor()
49+
public function testCreatesChainedCompletor(): void
5050
{
5151
$document = TextDocumentBuilder::create(self::EXAMPLE_SOURCE)->build();
5252
$this->completor1->complete(
@@ -67,7 +67,7 @@ public function testCreatesChainedCompletor()
6767
$this->assertEquals(self::EXAMPLE_SUGGESTION, $results[0]->name());
6868
}
6969

70-
public function testCreatesFormatterFromEitherSingleFormatterOrArray()
70+
public function testCreatesFormatterFromEitherSingleFormatterOrArray(): void
7171
{
7272
$object = new stdClass();
7373
$this->formatter1->canFormat($object)->shouldBeCalledTimes(3)->willReturn(false);
@@ -77,7 +77,7 @@ public function testCreatesFormatterFromEitherSingleFormatterOrArray()
7777
$this->assertEquals(false, $canFormat);
7878
}
7979

80-
public function testCreatesSignatureHelper()
80+
public function testCreatesSignatureHelper(): void
8181
{
8282
$document = TextDocumentBuilder::create(self::EXAMPLE_SOURCE)->build();
8383
$this->signatureHelper1->signatureHelp(

0 commit comments

Comments
 (0)