Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit 3282785

Browse files
Merge branch '0.2'
2 parents 80dd646 + 6bfa0b2 commit 3282785

File tree

6 files changed

+45
-2
lines changed

6 files changed

+45
-2
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
script:
3131
- vendor/bin/phpcs -p
3232

33+
- stage: Code Quality
34+
env: STATIC_ANALYSIS
35+
script:
36+
- vendor/bin/phpstan analyse
37+
3338
stages:
3439
- Test
3540
- name: Code Quality

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"ext-mbstring": "*",
2424
"ext-tokenizer": "*",
2525
"lstrojny/functional-php": "^1.8",
26+
"phpstan/phpstan": "^0.10",
27+
"phpstan/phpstan-phpunit": "^0.10",
2628
"phpunit/phpunit": "^7.3",
2729
"symfony/finder": "^4.1"
2830
},

phpstan.neon.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
autoload_files:
3+
- vendor/squizlabs/php_codesniffer/autoload.php
4+
level: max
5+
paths:
6+
- src
7+
- tests
8+
9+
includes:
10+
- vendor/phpstan/phpstan-phpunit/extension.neon
11+
- vendor/phpstan/phpstan-phpunit/rules.neon

src/Libero/ruleset.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
<property name="allowFallbackGlobalFunctions" value="false"/>
3333
</properties>
3434
</rule>
35-
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
35+
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
36+
<properties>
37+
<property name="searchAnnotations" value="true"/>
38+
</properties>
39+
</rule>
3640
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
3741
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
3842
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"/>

tests/RulesetTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function it_finds_and_fixes_violations(
6262
sort($actual);
6363
sort($messages);
6464

65-
$this->assertSame($messages, $actual, $description);
65+
$this->assertSame($messages, $actual, $description ?? '');
6666
if ($fixedEncoding) {
6767
$this->assertSame($fixedEncoding, mb_detect_encoding($file->fixer->getContents(), 'UTF-8', true));
6868
}

tests/cases/php/use-unused

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---DESCRIPTION---
22
Use statements must be used
3+
---FILENAME---
4+
Grault.php
35
---CONTENTS---
46
<?php
57

@@ -9,16 +11,35 @@ namespace Vendor;
911

1012
use Foo;
1113
use Bar\Baz;
14+
use Garply;
1215
use const QUX;
1316
use const Bar\QUUX;
1417
use function quuz;
1518
use function Bar\corge;
1619

20+
interface Grault
21+
{
22+
/**
23+
* @throws Garply
24+
*/
25+
public function waldo() : void;
26+
}
27+
1728
---FIXED---
1829
<?php
1930

2031
declare(strict_types=1);
2132

2233
namespace Vendor;
2334

35+
use Garply;
36+
37+
interface Grault
38+
{
39+
/**
40+
* @throws Garply
41+
*/
42+
public function waldo() : void;
43+
}
44+
2445
---

0 commit comments

Comments
 (0)