Skip to content

Commit 150fc8b

Browse files
committed
Fix deprectaed and tests
1 parent e1f392d commit 150fc8b

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Handler/Contract/EventHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ public function dispatch(object $event, ?string $queue = null, ?int $delay = nul
1616
*
1717
* @param Instance<T> $instance
1818
*/
19-
public function listen(Instance $instance, string $name, Transport $transport = null, int $priority = 0): void;
19+
public function listen(Instance $instance, string $name, ?Transport $transport = null, int $priority = 0): void;
2020
}

src/Handler/Impl/Cache/DoctrineCacheHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class DoctrineCacheHandler implements CacheHandler
1919

2020
private CacheItemPoolInterface $pool;
2121

22-
public function __construct(CacheItemPoolInterface $pool = null, ?string $name = null)
22+
public function __construct(?CacheItemPoolInterface $pool = null, ?string $name = null)
2323
{
2424
$this->pool = $pool ?? new ArrayAdapter(storeSerialized: false);
2525
$this->name = $name;
@@ -67,7 +67,7 @@ public function getName(): string
6767
return $this->name ?? 'doctrine_array';
6868
}
6969

70-
private function fetchWithNamespace(string $id, string $namespaceId = null): CacheItemInterface
70+
private function fetchWithNamespace(string $id, ?string $namespaceId = null): CacheItemInterface
7171
{
7272
if ($namespaceId !== null) {
7373
$namespace = $this->doFetch($namespaceId);

tests/Interceptor/EventInterceptorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function testMultiEventsSendMultiple(): void
121121

122122
public function testMessageClassEventDispatchedWithObjectResponse(): void
123123
{
124-
$proxy = $this->proxyFactory->createProxy(new ObjectResponseMessageClassAnnotatedClass());
124+
$proxy = $this->proxyFactory->createInstance(ObjectResponseMessageClassAnnotatedClass::class);
125125
$result = $proxy->handle('world');
126126

127127
$this->assertInstanceOf(ResponseObject::class, $result);
@@ -146,7 +146,7 @@ public function testMessageClassEventDispatchedWithObjectResponse(): void
146146

147147
public function testInvalidResponseForMessageClassThrowsException(): void
148148
{
149-
$proxy = $this->proxyFactory->createProxy(new InvalidResponseMessageClassAnnotatedClass());
149+
$proxy = $this->proxyFactory->createInstance(InvalidResponseMessageClassAnnotatedClass::class);
150150

151151
$this->expectException(\InvalidArgumentException::class);
152152
$proxy->invalid('test');

tests/Interceptor/LockInterceptorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function setUp(): void
3939
),
4040
]
4141
);
42-
$this->proxy = $this->proxyFactory->createProxy(new LockAnnotatedStub());
42+
$this->proxy = $this->proxyFactory->createInstance(LockAnnotatedStub::class);
4343
}
4444

4545
public function test(): void

0 commit comments

Comments
 (0)