Skip to content

Commit

Permalink
test(phpstan): Update PHPStan config options
Browse files Browse the repository at this point in the history
  • Loading branch information
klausi committed May 30, 2024
1 parent 46a63fd commit a8d26de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
# Pin the exact Coder version to upgrade manually when we want to.
run: |
composer --no-interaction --no-progress require \
phpstan/phpstan:^1.10.38 \
phpstan/phpstan:^1.11.2 \
mglaman/phpstan-drupal:^1.1.2 \
phpstan/phpstan-deprecation-rules:^1.0.0 \
jangregor/phpstan-prophecy:^1.0.0 \
Expand Down
13 changes: 3 additions & 10 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ parameters:
customRulesetUsed: true
paths:
- .
# We inherit a lot of Drupal core docs that don't specify iterable types on
# arrays, not sure we can fix this in a good way.
checkMissingIterableValueType: false
# Not sure we can specify generic types properly with Drupal coding standards
# yet, disable for now.
checkGenericClassInNonGenericObjectType: false
excludePaths:
# Exclude the RouteLoad producer because the redirect module is not D10
# compatible so we are not downloading it.
- src/Plugin/GraphQL/DataProducer/Routing/RouteLoad.php
ignoreErrors:
# We inherit a lot of Drupal core docs that don't specify iterable types on
# arrays, not sure we can fix this in a good way.
- identifier: missingType.iterableValue
# @todo Ignore phpstan-drupal extension's rules for now, activate later.
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
# new static() is a best practice in Drupal, so we cannot fix that.
Expand Down
16 changes: 8 additions & 8 deletions src/GraphQL/Buffers/BufferBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ abstract class BufferBase {
/**
* The the array of buffers.
*
* @var \SplObjectStorage[]
* @var \SplObjectStorage<object, object>[]
*/
protected $buffers = [];

/**
* The array of result sets.
*
* @var \SplObjectStorage[]
* @var \SplObjectStorage<object, object>[]
*/
protected $results = [];

Expand Down Expand Up @@ -65,9 +65,9 @@ public function createBufferResolver($item) {
*
* @param object $item
* The item to add to create the resolver for.
* @param \SplObjectStorage $buffer
* @param \SplObjectStorage<object, object> $buffer
* The buffer.
* @param \SplObjectStorage $result
* @param \SplObjectStorage<object, object> $result
* The result set.
*
* @return \Closure
Expand All @@ -85,9 +85,9 @@ protected function createResolver($item, \SplObjectStorage $buffer, \SplObjectSt
*
* @param object $item
* The buffer item to retrieve the result for.
* @param \SplObjectStorage $buffer
* @param \SplObjectStorage<object, object> $buffer
* The buffer.
* @param \SplObjectStorage $result
* @param \SplObjectStorage<object, object> $result
* The result set.
*
* @return mixed
Expand All @@ -112,10 +112,10 @@ protected function resolveItem($item, \SplObjectStorage $buffer, \SplObjectStora
/**
* Resolves the given buffer wholly.
*
* @param \SplObjectStorage $buffer
* @param \SplObjectStorage<object, object> $buffer
* The buffer to be resolved wholly.
*
* @return \SplObjectStorage
* @return \SplObjectStorage<object, object>
* The resolved results for the given buffer, keyed by the corresponding
* buffer items.
*/
Expand Down

0 comments on commit a8d26de

Please sign in to comment.