Skip to content

Commit 8cdbc1b

Browse files
authored
Merge pull request #1373 from JimTools/bugfix/static-drift
Bugfix/static drift
2 parents fcaa718 + a6d8669 commit 8cdbc1b

18 files changed

+29
-39
lines changed

phpstan.neon

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,3 @@ parameters:
1414
- pkg/enqueue-bundle/DependencyInjection/Configuration.php
1515
- pkg/enqueue/Tests/Symfony/DependencyInjection/TransportFactoryTest.php
1616
- pkg/simple-client/SimpleClient.php
17-
ignoreErrors:
18-
-
19-
message: '#Class Symfony\\Component\\EventDispatcher\\LegacyEventDispatcherProxy not found#'
20-
path: %currentWorkingDirectory%/*
21-
-
22-
message: '#.*Symfony\\Contracts\\EventDispatcher\\Event.*#'
23-
path: %currentWorkingDirectory%/*

pkg/enqueue/Client/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public static function create(
163163
array $transportConfig = [],
164164
array $driverConfig = [],
165165
): self {
166-
return new static(
166+
return new self(
167167
$prefix ?: '',
168168
$separator ?: '.',
169169
$app ?: '',

pkg/enqueue/Client/Driver/StompManagementClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(Client $client, string $vhost = '/')
2424

2525
public static function create(string $vhost = '/', string $host = 'localhost', int $port = 15672, string $login = 'guest', string $password = 'guest'): self
2626
{
27-
return new static(new Client(null, 'http://'.$host.':'.$port, $login, $password), $vhost);
27+
return new self(new Client(null, 'http://'.$host.':'.$port, $login, $password), $vhost);
2828
}
2929

3030
public function declareQueue(string $name, array $options)

pkg/enqueue/Consumption/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class InvalidArgumentException extends \InvalidArgumentException implements Exce
1212
public static function assertInstanceOf($argument, $class)
1313
{
1414
if (false == $argument instanceof $class) {
15-
throw new static(sprintf('The argument must be an instance of %s but got %s.', $class, is_object($argument) ? $argument::class : gettype($argument)));
15+
throw new self(sprintf('The argument must be an instance of %s but got %s.', $class, is_object($argument) ? $argument::class : gettype($argument)));
1616
}
1717
}
1818
}

pkg/enqueue/Consumption/Result.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function setReply(?InteropMessage $reply = null)
8989
*/
9090
public static function ack($reason = '')
9191
{
92-
return new static(self::ACK, $reason);
92+
return new self(self::ACK, $reason);
9393
}
9494

9595
/**
@@ -99,7 +99,7 @@ public static function ack($reason = '')
9999
*/
100100
public static function reject($reason)
101101
{
102-
return new static(self::REJECT, $reason);
102+
return new self(self::REJECT, $reason);
103103
}
104104

105105
/**
@@ -109,7 +109,7 @@ public static function reject($reason)
109109
*/
110110
public static function requeue($reason = '')
111111
{
112-
return new static(self::REQUEUE, $reason);
112+
return new self(self::REQUEUE, $reason);
113113
}
114114

115115
/**
@@ -122,7 +122,7 @@ public static function reply(InteropMessage $replyMessage, $status = self::ACK,
122122
{
123123
$status = null === $status ? self::ACK : $status;
124124

125-
$result = new static($status, $reason);
125+
$result = new self($status, $reason);
126126
$result->setReply($replyMessage);
127127

128128
return $result;

pkg/enqueue/Rpc/TimeoutException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class TimeoutException extends \LogicException
1212
*/
1313
public static function create($timeout, $correlationId)
1414
{
15-
return new static(sprintf('Rpc call timeout is reached without receiving a reply message. Timeout: %s, CorrelationId: %s', $timeout, $correlationId));
15+
return new self(sprintf('Rpc call timeout is reached without receiving a reply message. Timeout: %s, CorrelationId: %s', $timeout, $correlationId));
1616
}
1717
}

pkg/enqueue/Symfony/Client/SetupBrokerExtensionCommandTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function configureSetupBrokerExtension()
1818
}
1919

2020
/**
21-
* @return ExtensionInterface
21+
* @return ExtensionInterface|null
2222
*/
2323
protected function getSetupBrokerExtension(InputInterface $input, DriverInterface $driver)
2424
{

pkg/enqueue/Symfony/DiUtils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(string $moduleName, string $configName)
2727

2828
public static function create(string $moduleName, string $configName): self
2929
{
30-
return new static($moduleName, $configName);
30+
return new self($moduleName, $configName);
3131
}
3232

3333
public function getModuleName(): string

pkg/enqueue/Tests/Consumption/FallbackSubscriptionConsumerTest.php

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,34 +147,18 @@ public function testShouldConsumeMessagesFromTwoQueuesInExpectedOrder()
147147
$fourthMessage = $this->createMessageStub('fourth');
148148
$fifthMessage = $this->createMessageStub('fifth');
149149

150-
$fooMessages = [null, $firstMessage, null, $secondMessage, $thirdMessage];
151-
152150
$fooConsumer = $this->createConsumerStub('foo_queue');
153151
$fooConsumer
154152
->expects($this->any())
155153
->method('receiveNoWait')
156-
->willReturnCallback(function () use (&$fooMessages) {
157-
if (empty($fooMessages)) {
158-
return null;
159-
}
160-
161-
return array_shift($fooMessages);
162-
})
154+
->willReturnOnConsecutiveCalls(null, $firstMessage, null, $secondMessage, $thirdMessage)
163155
;
164156

165-
$barMessages = [$fourthMessage, null, null, $fifthMessage];
166-
167157
$barConsumer = $this->createConsumerStub('bar_queue');
168158
$barConsumer
169159
->expects($this->any())
170160
->method('receiveNoWait')
171-
->willReturnCallback(function () use (&$barMessages) {
172-
if (empty($barMessages)) {
173-
return null;
174-
}
175-
176-
return array_shift($barMessages);
177-
})
161+
->willReturnOnConsecutiveCalls($fourthMessage, null, null, $fifthMessage)
178162
;
179163

180164
$actualOrder = [];

pkg/enqueue/Tests/Mocks/JsonSerializableObject.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
class JsonSerializableObject implements \JsonSerializable
66
{
7-
public function jsonSerialize()
7+
#[\ReturnTypeWillChange]
8+
public function jsonSerialize(): array
89
{
910
return ['foo' => 'fooVal'];
1011
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy