Skip to content

Commit

Permalink
Fix phpstan level 1 issues
Browse files Browse the repository at this point in the history
Some parent constructor calls are missing, but it looks like it's done on purpose so I decided to ignore the errors
  • Loading branch information
Sam Stenvall committed Oct 11, 2019
1 parent d4409fd commit 9bacb66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ script:
- |
if [[ $STATIC_ANALYSIS == true ]]; then
composer require --ignore-platform-reqs --dev phpstan/phpstan
vendor/bin/phpstan analyze src --level max
vendor/bin/phpstan analyze src -c phpstan.neon -l 1
fi
after_script:
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 9bacb66

Please sign in to comment.