Skip to content

Commit

Permalink
Remove Argument deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg-web committed May 4, 2021
1 parent d7184a3 commit 2ccbb6e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 32 deletions.
6 changes: 6 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ UPGRADE FROM 0.13 to 0.14
- [Replace `overblog_graphql.global_variable` tag](#replace-overblog_graphqlglobal_variable-tag)
- [Replace `resolver` expression function](#replace-resolver-expression-function)
- [Rename `ResolverInterface` to `QueryInterface`](#rename-resolverinterface-to-queryinterface)
- [Remove Argument deprecated method](#remove-argument-deprecated-method)

### Customize the cursor encoder of the edges of a connection

Expand Down Expand Up @@ -199,6 +200,11 @@ Example:
}
```

### Remove Argument deprecated method

Method `Overblog\GraphQLBundle\Definition\Argument::getRawArguments` is replaced by
`Overblog\GraphQLBundle\Definition\Argument::getArrayCopy`.


UPGRADE FROM 0.12 to 0.13
=======================
Expand Down
20 changes: 0 additions & 20 deletions src/Definition/Argument.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

use function array_key_exists;
use function count;
use function sprintf;
use function trigger_error;
use const E_USER_DEPRECATED;

class Argument implements ArgumentInterface
{
Expand All @@ -32,23 +29,6 @@ public function getArrayCopy(): array
return $this->rawArguments;
}

/**
* @deprecated This method is deprecated since 0.12 and will be removed in 0.13. You should use getArrayCopy method instead.
*/
public function getRawArguments(): array
{
@trigger_error(
sprintf(
'This "%s" method is deprecated since 0.12 and will be removed in 0.13. You should use "%s::getArrayCopy" instead.',
__METHOD__,
__CLASS__
),
E_USER_DEPRECATED
);

return $this->getArrayCopy();
}

/**
* @param int|string $offset
*/
Expand Down
10 changes: 0 additions & 10 deletions tests/Definition/ArgumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,4 @@ public function testGetRawArgs(): void
{
$this->assertSame($this->rawArgs, $this->argument->getArrayCopy());
}

/**
* @group legacy
*
* @expectedDeprecation This "%s" method is deprecated since 0.12 and will be removed in 0.13. You should use "%s::getArrayCopy" instead.
*/
public function testDeprecatedGetRawArgs(): void
{
$this->assertSame($this->rawArgs, $this->argument->getRawArguments());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Mutation:
defaultValue: 'foo'
isStringNull:
type: Boolean!
resolve: "@=null === args.getRawArguments()['string']"
resolve: "@=null === args.getArrayCopy()['string']"
args:
string:
type: String
Expand All @@ -24,7 +24,7 @@ Mutation:
type: EchoInput!
isStringNullUsingInput:
type: Boolean!
resolve: "@=null === args.getRawArguments()['input']['string']"
resolve: "@=null === args.getArrayCopy()['input']['string']"
args:
input:
type: isStringNullInput!
Expand Down

0 comments on commit 2ccbb6e

Please sign in to comment.