Skip to content

Commit f824750

Browse files
authored
Merge pull request #23 from ray-di/update-qa
Support guzzle 7
2 parents 6751229 + c77db0d commit f824750

File tree

6 files changed

+209
-204
lines changed

6 files changed

+209
-204
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"aura/sql": "^3.0",
1717
"bear/resource": "^1.15",
1818
"doctrine/annotations": "^1.11",
19-
"guzzlehttp/guzzle": "^6.3",
19+
"guzzlehttp/guzzle": "^6.3 || ^7.0",
2020
"koriym/query-locator": "^1.4",
2121
"ray/aop": "^2.10.3",
2222
"ray/aura-sql-module": "^1.10.0",

src/Annotation/Query.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Ray\Query\Annotation;
66

77
use Attribute;
8-
use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation;
8+
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
99
use Ray\Query\Exception\QueryTypeException;
1010

1111
/**
@@ -14,9 +14,10 @@
1414
* @Annotation
1515
* @Target("METHOD")
1616
* @psalm-suppress MissingConstructor
17+
* @NamedArgumentConstructor
1718
*/
1819
#[Attribute(Attribute::TARGET_METHOD)]
19-
final class Query implements NamedArgumentConstructorAnnotation
20+
final class Query
2021
{
2122
/**
2223
* Query ID

src/QueryInterceptor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use InvalidArgumentException;
99
use Ray\Aop\MethodInterceptor;
1010
use Ray\Aop\MethodInvocation;
11-
use Ray\Aop\ReflectionMethod;
1211
use Ray\Di\InjectorInterface;
1312
use Ray\Query\Annotation\Query;
1413

@@ -32,7 +31,6 @@ public function __construct(InjectorInterface $injector)
3231
*/
3332
public function invoke(MethodInvocation $invocation)
3433
{
35-
/** @var ReflectionMethod $method */
3634
$method = $invocation->getMethod();
3735
/** @var Query $query */
3836
$query = $method->getAnnotation(Query::class);

src/WebQueryModule.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class WebQueryModule extends AbstractModule
1515
/** @var array<string, mixed> */
1616
private $guzzleConfig;
1717

18-
/** @var array<string, string> */
18+
/** @var array<string, array{0: string, 1:string}> */
1919
private $webQueryConfig;
2020

2121
/**
22-
* @param array<string, string> $webQueryConfig
23-
* @param array<string, mixed> $guzzleConfig
22+
* @param array<string, array{0: string, 1:string}> $webQueryConfig
23+
* @param array<string, mixed> $guzzleConfig
2424
*/
2525
public function __construct(array $webQueryConfig, array $guzzleConfig, ?AbstractModule $module = null)
2626
{
@@ -36,7 +36,6 @@ protected function configure()
3636
{
3737
$this->configureClient();
3838
foreach ($this->webQueryConfig as $name => $value) {
39-
/** @var array{0: string, 1: string} $value */
4039
[$method, $uri] = $value;
4140
$this->configureWebQuery($name, $method, $uri);
4241
}

tests/WebQueryModuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected function setUp(): void
2020
'bar' => ['GET', 'https://httpbin.org/anything/bar'],
2121
];
2222
$guzzleConfig = [];
23-
/** @var array<string, string> $webQueryConfig */
2423
$this->module = new WebQueryModule($webQueryConfig, $guzzleConfig);
2524
}
2625

0 commit comments

Comments
 (0)