Skip to content

Commit 2ffc932

Browse files
authored
Merge pull request #1 from umulmrum/scrutinizer
Add Scrutinizer.
2 parents 78faed9 + 1ece692 commit 2ffc932

File tree

8 files changed

+29
-58
lines changed

8 files changed

+29
-58
lines changed

.scrutinizer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
build:
2+
tests:
3+
override:
4+
-
5+
command: 'vendor/bin/phpunit --coverage-clover=clover.xml'
6+
coverage:
7+
file: 'clover.xml'
8+
format: 'clover'
9+
10+
checks:
11+
php:
12+
code_rating: true
13+
duplication: true
14+
15+
coding_style:
16+
php:
17+
spaces:
18+
around_operators:
19+
concatenation: true
20+
21+
filter:
22+
excluded_paths:
23+
- 'tests/*'

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ before_install:
2121
install:
2222
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
2323
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi
24-
25-
script:
26-
- phpunit
27-
- php coverage-checker.php clover.xml 90

coverage-checker.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,4 @@
1616
<directory>tests/</directory>
1717
</testsuite>
1818
</testsuites>
19-
20-
<filter>
21-
<whitelist addUncoveredFilesFromWhitelist="true">
22-
<directory suffix=".php">./src</directory>
23-
</whitelist>
24-
</filter>
25-
<logging>
26-
<log type="coverage-clover" target="./clover.xml"/>
27-
</logging>
2819
</phpunit>

src/JsonParser.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ public function generate(): \Generator
9292
} finally {
9393
$this->dataSource->finish();
9494
}
95-
96-
return null;
9795
}
9896

9997
/**

src/State/RootObjectState.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function run(DataSourceInterface $dataSource)
2727
}
2828

2929
InvalidJsonException::trigger('No value found for key', $dataSource);
30+
// no break
3031
case '"':
3132
if (null !== $currentKey) {
3233
InvalidJsonException::trigger('Invalid character \'"\', ":" expected', $dataSource);

tests/DataSource/FileDataSourceTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace umulmrum\JsonParser\Test\DataSource;
44

55
use PHPUnit\Framework\TestCase;
6-
use umulmrum\JsonParser\DataSource\DataSourceException;
76
use umulmrum\JsonParser\DataSource\FileDataSource;
8-
use umulmrum\JsonParser\InvalidJsonException;
97

108
class FileDataSourceTest extends TestCase
119
{

tests/JsonParserTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testAllValid(string $fileToCheck): void
6161

6262
public function provideDataForTestAllValid(): array
6363
{
64-
return $this->getTestCasesFromPath(__DIR__ . '/fixtures/valid');
64+
return $this->getTestCasesFromPath(__DIR__.'/fixtures/valid');
6565
}
6666

6767
private function getTestCasesFromPath(string $path): array
@@ -74,7 +74,7 @@ private function getTestCasesFromPath(string $path): array
7474
continue;
7575
}
7676

77-
$files[] = [ $entry ];
77+
$files[] = [$entry];
7878
}
7979

8080
\closedir($dir);
@@ -121,7 +121,7 @@ public function testAllInvalid(string $fileToCheck): void
121121

122122
public function provideDataForTestAllInvalid(): array
123123
{
124-
return $this->getTestCasesFromPath(__DIR__ . '/fixtures/invalid');
124+
return $this->getTestCasesFromPath(__DIR__.'/fixtures/invalid');
125125
}
126126

127127
private function givenADataSourceForInvalidFiles(string $fileToCheck): void
@@ -287,8 +287,8 @@ private function whenGenerateIsCalledUntilTheDataSourceIsDepleted(): void
287287
* @dataProvider provideDataForTestErrorInfo
288288
*
289289
* @param string $fileToCheck
290-
* @param int $expectedErrorLine
291-
* @param int $expectedErrorColumn
290+
* @param int $expectedErrorLine
291+
* @param int $expectedErrorColumn
292292
*/
293293
public function testErrorInfo(string $fileToCheck, int $expectedErrorLine, int $expectedErrorColumn): void
294294
{

0 commit comments

Comments
 (0)