Skip to content

Commit

Permalink
Merge pull request #233 from youshido-php/phpstan
Browse files Browse the repository at this point in the history
Run phpstan on Travis CI
  • Loading branch information
Jalle19 authored Nov 13, 2019
2 parents 0919269 + 9bacb66 commit 29a7d4f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
28 changes: 16 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
language: php
dist: trusty

php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
matrix:
include:
- php: 5.5
dist: trusty
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
env: STATIC_ANALYSIS=true

before_install:
- composer selfupdate

install: composer update --prefer-dist --no-interaction
install: composer install --prefer-dist --no-interaction

script:
- ./vendor/bin/phpunit --coverage-clover=coverage.clover
- |
if [[ $STATIC_ANALYSIS == true ]]; then
composer require --ignore-platform-reqs --dev phpstan/phpstan
vendor/bin/phpstan analyze src -c phpstan.neon -l 1
fi
after_script:
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
ignoreErrors:
- '#does not call parent constructor from#'
8 changes: 4 additions & 4 deletions src/Execution/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ protected function deferredResolve($resolvedValue, FieldInterface $field, callab
protected function resolveScalar(FieldInterface $field, AstFieldInterface $ast, $parentValue)
{
$resolvedValue = $this->doResolve($field, $ast, $parentValue);
return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field, $ast, $parentValue) {
return $this->deferredResolve($resolvedValue, $field, function($resolvedValue) use ($field) {
$this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);

/** @var AbstractScalarType $type */
Expand All @@ -436,7 +436,7 @@ protected function resolveList(FieldInterface $field, AstFieldInterface $ast, $p
/** @var AstQuery $ast */
$resolvedValue = $this->doResolve($field, $ast, $parentValue);

return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast) {
$this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);

if (null === $resolvedValue) {
Expand Down Expand Up @@ -507,7 +507,7 @@ protected function resolveObject(FieldInterface $field, AstFieldInterface $ast,
$resolvedValue = $this->doResolve($field, $ast, $parentValue);
}

return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast) {
$this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);

if (null === $resolvedValue) {
Expand All @@ -528,7 +528,7 @@ protected function resolveComposite(FieldInterface $field, AstFieldInterface $as
{
/** @var AstQuery $ast */
$resolvedValue = $this->doResolve($field, $ast, $parentValue);
return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast, $parentValue) {
return $this->deferredResolve($resolvedValue, $field, function ($resolvedValue) use ($field, $ast) {
$this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);

if (null === $resolvedValue) {
Expand Down

0 comments on commit 29a7d4f

Please sign in to comment.