Skip to content

Commit

Permalink
Merge 22aaf8f into c7ff82a
Browse files Browse the repository at this point in the history
  • Loading branch information
janlanger committed Nov 19, 2021
2 parents c7ff82a + 22aaf8f commit daec2fe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Expand Up @@ -596,7 +596,7 @@ parameters:
path: tests/Executor/DirectivesTest.php

-
message: "#^Anonymous function should have native return typehint \"class@anonymous/tests/Executor/ExecutorTest\\.php\\:1329\"\\.$#"
message: "#^Anonymous function should have native return typehint \"class@anonymous/tests/Executor/ExecutorTest\\.php\\:1331\"\\.$#"
count: 1
path: tests/Executor/ExecutorTest.php

Expand Down
2 changes: 1 addition & 1 deletion src/Executor/ExecutionResult.php
Expand Up @@ -115,7 +115,7 @@ public function setErrorsHandler(callable $handler)
/**
* @return mixed[]
*/
public function jsonSerialize()
public function jsonSerialize() : array
{
return $this->toArray();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Language/AST/NodeList.php
Expand Up @@ -9,6 +9,7 @@
use GraphQL\Utils\AST;
use InvalidArgumentException;
use IteratorAggregate;
use ReturnTypeWillChange;
use Traversable;
use function array_merge;
use function array_splice;
Expand Down Expand Up @@ -69,6 +70,7 @@ public function offsetExists($offset) : bool
*
* @phpstan-return T
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)// : Node
{
$item = $this->nodes[$offset];
Expand Down
12 changes: 5 additions & 7 deletions src/Utils/MixedStore.php
Expand Up @@ -7,6 +7,7 @@
use ArrayAccess;
use GraphQL\Type\Definition\EnumValueDefinition;
use InvalidArgumentException;
use ReturnTypeWillChange;
use SplObjectStorage;
use function array_key_exists;
use function array_search;
Expand Down Expand Up @@ -90,7 +91,7 @@ public function __construct()
* <p>
* The return value will be casted to boolean if non-boolean was returned.
*/
public function offsetExists($offset)
public function offsetExists($offset) : bool
{
if ($offset === false) {
return $this->falseValueIsSet;
Expand Down Expand Up @@ -135,6 +136,7 @@ public function offsetExists($offset)
*
* @return mixed Can return all value types.
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
if ($offset === true) {
Expand Down Expand Up @@ -181,10 +183,8 @@ public function offsetGet($offset)
* @param mixed $value <p>
* The value to set.
* </p>
*
* @return void
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value) : void
{
if ($offset === false) {
$this->falseValue = $value;
Expand Down Expand Up @@ -217,10 +217,8 @@ public function offsetSet($offset, $value)
* @param mixed $offset <p>
* The offset to unset.
* </p>
*
* @return void
*/
public function offsetUnset($offset)
public function offsetUnset($offset) : void
{
if ($offset === true) {
$this->trueValue = null;
Expand Down
8 changes: 5 additions & 3 deletions tests/Executor/ExecutorTest.php
Expand Up @@ -24,6 +24,7 @@
use GraphQL\Type\Definition\Type;
use GraphQL\Type\Schema;
use PHPUnit\Framework\TestCase;
use ReturnTypeWillChange;
use stdClass;
use function count;
use function json_encode;
Expand Down Expand Up @@ -1279,7 +1280,7 @@ public function testDefaultResolverGrabsValuesOffOfCommonPhpDataStructures() : v
'type' => $ArrayAccess,
'resolve' => static function () : ArrayAccess {
return new class implements ArrayAccess {
public function offsetExists($offset)
public function offsetExists($offset) : bool
{
switch ($offset) {
case 'set':
Expand All @@ -1289,6 +1290,7 @@ public function offsetExists($offset)
}
}

#[ReturnTypeWillChange]
public function offsetGet($offset)
{
switch ($offset) {
Expand All @@ -1301,11 +1303,11 @@ public function offsetGet($offset)
}
}

public function offsetSet($offset, $value)
public function offsetSet($offset, $value) : void
{
}

public function offsetUnset($offset)
public function offsetUnset($offset) : void
{
}
};
Expand Down

0 comments on commit daec2fe

Please sign in to comment.