Skip to content

Fix deprecations in 0.14 #952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
"murtukov/php-code-generator": "^0.1.5",
"phpdocumentor/reflection-docblock": "^5.2",
"psr/log": "^1.0",
"symfony/config": "^4.4 || ^5.3",
"symfony/dependency-injection": "^4.4 || ^5.3",
"symfony/config": "^4.4.30 || ^5.3.7",
"symfony/dependency-injection": "^4.4.30 || ^5.3.7",
"symfony/event-dispatcher": "^4.4 || ^5.3",
"symfony/expression-language": "^4.4 || ^5.3",
"symfony/framework-bundle": "^4.4 || ^5.3",
"symfony/framework-bundle": "^4.4.30 || ^5.3.7",
"symfony/http-foundation": "^4.4.30 || ^5.3.7",
"symfony/http-kernel": "^4.4 || ^5.3",
"symfony/options-resolver": "^4.4 || ^5.3",
"symfony/property-access": "^4.4 || ^5.3",
"webonyx/graphql-php": ">=14.5"
Expand All @@ -48,22 +50,26 @@
"require-dev": {
"doctrine/annotations": "^1.13",
"doctrine/orm": "^2.5",
"monolog/monolog": "^1.26.1",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.58",
"phpstan/phpstan-phpunit": "^0.12.11",
"phpstan/phpstan-symfony": "^0.12.6",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5.10",
"react/promise": "^2.5",
"symfony/asset": "^4.4 || ^5.3",
"symfony/browser-kit": "^4.4 || ^5.3",
"symfony/console": "^4.4 || ^5.3",
"symfony/css-selector": "^4.4 || ^5.3",
"symfony/console": "^4.4.30 || ^5.3",
"symfony/dom-crawler": "^4.4.30 || ^5.3.7",
"symfony/finder": "^4.4.30 || ^5.3.7",
"symfony/monolog-bundle": "^3.7",
"symfony/phpunit-bridge": "^6.0",
"symfony/process": "^4.4 || ^5.3",
"symfony/process": "^4.4.30 || ^5.3.7",
"symfony/routing": "^4.4 || ^5.3.7",
"symfony/security-bundle": "^4.4 || ^5.3",
"symfony/validator": "^4.4 || ^5.3",
"symfony/var-dumper": "^4.4 || ^5.3",
"symfony/validator": "^4.4.30 || ^5.3.7",
"symfony/var-dumper": "^4.4.30 || ^5.3.7",
"symfony/yaml": "^4.4 || ^5.3",
"twig/twig": "^2.10|^3.0"
},
Expand Down
3 changes: 2 additions & 1 deletion src/Definition/Argument.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Overblog\GraphQLBundle\Definition;

use ReturnTypeWillChange;
use function array_key_exists;
use function count;

Expand Down Expand Up @@ -42,7 +43,7 @@ public function offsetExists($offset): bool
*
* @return mixed|null
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
// TODO 1.0: Drop PHP 7.4 support and add mixed return type.
Expand Down
4 changes: 4 additions & 0 deletions src/Definition/Type/CustomScalarType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use GraphQL\Type\Definition\CustomScalarType as BaseCustomScalarType;
use GraphQL\Type\Definition\ScalarType;
use GraphQL\Utils\Utils;
use ReturnTypeWillChange;
use function call_user_func;
use function is_callable;
use function sprintf;
Expand All @@ -25,6 +26,7 @@ public function __construct(array $config = [])
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function serialize($value)
{
return $this->call('serialize', $value);
Expand All @@ -33,6 +35,7 @@ public function serialize($value)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function parseValue($value)
{
return $this->call('parseValue', $value);
Expand All @@ -41,6 +44,7 @@ public function parseValue($value)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function parseLiteral(/* GraphQL\Language\AST\ValueNode */ $valueNode, array $variables = null)
{
return $this->call('parseLiteral', $valueNode);
Expand Down
2 changes: 2 additions & 0 deletions src/Upload/Type/GraphQLUploadType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use GraphQL\Error\InvariantViolation;
use GraphQL\Type\Definition\ScalarType;
use ReturnTypeWillChange;
use Symfony\Component\HttpFoundation\File\File;
use function get_class;
use function gettype;
Expand All @@ -31,6 +32,7 @@ public function __construct(string $name = null)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function parseValue($value)
{
if (null !== $value && !$value instanceof File) {
Expand Down
2 changes: 2 additions & 0 deletions src/Validator/Mapping/PropertyMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use ReflectionException;
use ReflectionProperty;
use ReturnTypeWillChange;
use Symfony\Component\Validator\Mapping\MemberMetadata;

class PropertyMetadata extends MemberMetadata
Expand All @@ -28,6 +29,7 @@ protected function newReflectionMember($object): ReflectionProperty
return $member;
}

#[ReturnTypeWillChange]
public function getPropertyValue($object)
{
return $this->getReflectionMember($object)->getValue($object);
Expand Down
3 changes: 3 additions & 0 deletions tests/Config/Parser/AnnotationParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
* @group legacy
*/
class AnnotationParserTest extends MetadataParserTest
{
public function setUp(): void
Expand Down
4 changes: 4 additions & 0 deletions tests/Functional/App/Type/YearScalarType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use GraphQL\Error\Error;
use GraphQL\Language\AST\StringValueNode;
use GraphQL\Type\Definition\ScalarType;
use ReturnTypeWillChange;
use function sprintf;
use function str_replace;

Expand All @@ -15,6 +16,7 @@ class YearScalarType extends ScalarType
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function serialize($value)
{
return sprintf('%s AC', $value);
Expand All @@ -23,6 +25,7 @@ public function serialize($value)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function parseValue($value)
{
return (int) str_replace(' AC', '', $value);
Expand All @@ -31,6 +34,7 @@ public function parseValue($value)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function parseLiteral($valueNode, array $variables = null)
{
if (!$valueNode instanceof StringValueNode) {
Expand Down