Check CS in the whole project

Closes #284
This commit is contained in:
Simon Podlipsky 2018-09-02 16:31:14 +02:00
parent a4edb34deb
commit 7dbd72cebf
No known key found for this signature in database
GPG Key ID: 725C2BD962B42663
8 changed files with 30 additions and 33 deletions

View File

@ -45,21 +45,9 @@ jobs:
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml
- stage: Pull request coding standard
if: type = pull_request
- stage: Coding standard
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- |
if [ $TRAVIS_BRANCH != "master" ]; then
git remote set-branches --add origin $TRAVIS_BRANCH;
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA
# - stage: Coding standard
# if: NOT type = pull_request
# php: 7.1
# install: travis_retry composer install --prefer-dist
# script:
# - ./vendor/bin/phpcs
- ./vendor/bin/phpcs

View File

@ -65,7 +65,7 @@ values. Int can represent values between -(2^31) and 2^31 - 1. ';
}
$int = intval($num);
// int cast with == used for performance reasons
// @codingStandardsIgnoreLine
// phpcs:ignore
if ($int != $num) {
throw new Error(
'Int cannot represent non-integer value: ' .

View File

@ -255,7 +255,7 @@ class AST
}
if (is_float($serialized)) {
// int cast with == used for performance reasons
// @codingStandardsIgnoreLine
// phpcs:ignore
if ((int) $serialized == $serialized) {
return new IntValueNode(['value' => $serialized]);
}

View File

@ -9,6 +9,9 @@ use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
use function strtolower;
/**
* phpcs:ignoreFile -- this is not a core file
*/
class PsrRequestStub implements ServerRequestInterface
{
public $queryParams = [];

View File

@ -7,6 +7,9 @@ namespace GraphQL\Tests\Server\Psr7;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* phpcs:ignoreFile -- this is not a core file
*/
class PsrResponseStub implements ResponseInterface
{
public $headers = [];

View File

@ -8,6 +8,9 @@ use Psr\Http\Message\StreamInterface;
use function strlen;
use const SEEK_SET;
/**
* phpcs:ignoreFile -- this is not a core file
*/
class PsrStreamStub implements StreamInterface
{
public $content;

View File

@ -148,7 +148,7 @@ class StarWarsData
}
/**
* @param $id
* @param string $id
* @return mixed|null
*/
public static function getHuman($id)
@ -159,7 +159,7 @@ class StarWarsData
}
/**
* @param $id
* @param string $id
* @return mixed|null
*/
public static function getDroid($id)