Skip to content

Add Scrutinizer. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build:
tests:
override:
-
command: 'vendor/bin/phpunit --coverage-clover=clover.xml'
coverage:
file: 'clover.xml'
format: 'clover'

checks:
php:
code_rating: true
duplication: true

coding_style:
php:
spaces:
around_operators:
concatenation: true

filter:
excluded_paths:
- 'tests/*'
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ before_install:
install:
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi

script:
- phpunit
- php coverage-checker.php clover.xml 90
36 changes: 0 additions & 36 deletions coverage-checker.php

This file was deleted.

9 changes: 0 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,4 @@
<directory>tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="./clover.xml"/>
</logging>
</phpunit>
2 changes: 0 additions & 2 deletions src/JsonParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ public function generate(): \Generator
} finally {
$this->dataSource->finish();
}

return null;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/State/RootObjectState.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function run(DataSourceInterface $dataSource)
}

InvalidJsonException::trigger('No value found for key', $dataSource);
// no break
case '"':
if (null !== $currentKey) {
InvalidJsonException::trigger('Invalid character \'"\', ":" expected', $dataSource);
Expand Down
2 changes: 0 additions & 2 deletions tests/DataSource/FileDataSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace umulmrum\JsonParser\Test\DataSource;

use PHPUnit\Framework\TestCase;
use umulmrum\JsonParser\DataSource\DataSourceException;
use umulmrum\JsonParser\DataSource\FileDataSource;
use umulmrum\JsonParser\InvalidJsonException;

class FileDataSourceTest extends TestCase
{
Expand Down
10 changes: 5 additions & 5 deletions tests/JsonParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testAllValid(string $fileToCheck): void

public function provideDataForTestAllValid(): array
{
return $this->getTestCasesFromPath(__DIR__ . '/fixtures/valid');
return $this->getTestCasesFromPath(__DIR__.'/fixtures/valid');
}

private function getTestCasesFromPath(string $path): array
Expand All @@ -74,7 +74,7 @@ private function getTestCasesFromPath(string $path): array
continue;
}

$files[] = [ $entry ];
$files[] = [$entry];
}

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

public function provideDataForTestAllInvalid(): array
{
return $this->getTestCasesFromPath(__DIR__ . '/fixtures/invalid');
return $this->getTestCasesFromPath(__DIR__.'/fixtures/invalid');
}

private function givenADataSourceForInvalidFiles(string $fileToCheck): void
Expand Down Expand Up @@ -287,8 +287,8 @@ private function whenGenerateIsCalledUntilTheDataSourceIsDepleted(): void
* @dataProvider provideDataForTestErrorInfo
*
* @param string $fileToCheck
* @param int $expectedErrorLine
* @param int $expectedErrorColumn
* @param int $expectedErrorLine
* @param int $expectedErrorColumn
*/
public function testErrorInfo(string $fileToCheck, int $expectedErrorLine, int $expectedErrorColumn): void
{
Expand Down