Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8cdbc1b

Browse files
authored
Merge pull request#1373 from JimTools/bugfix/static-drift
Bugfix/static drift
2 parentsfcaa718 +a6d8669 commit8cdbc1b

File tree

18 files changed

+29
-39
lines changed

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-
returnnewstatic(
166+
returnnewself(
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
publicstaticfunctioncreate(string$vhost ='/',string$host ='localhost',int$port =15672,string$login ='guest',string$password ='guest'):self
2626
{
27-
returnnewstatic(newClient(null,'http://'.$host.':'.$port,$login,$password),$vhost);
27+
returnnewself(newClient(null,'http://'.$host.':'.$port,$login,$password),$vhost);
2828
}
2929

3030
publicfunctiondeclareQueue(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
publicstaticfunctionassertInstanceOf($argument,$class)
1313
{
1414
if (false ==$argumentinstanceof$class) {
15-
thrownewstatic(sprintf('The argument must be an instance of %s but got %s.',$class,is_object($argument) ?$argument::class :gettype($argument)));
15+
thrownewself(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
publicstaticfunctionack($reason ='')
9191
{
92-
returnnewstatic(self::ACK,$reason);
92+
returnnewself(self::ACK,$reason);
9393
}
9494

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

105105
/**
@@ -109,7 +109,7 @@ public static function reject($reason)
109109
*/
110110
publicstaticfunctionrequeue($reason ='')
111111
{
112-
returnnewstatic(self::REQUEUE,$reason);
112+
returnnewself(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 =newstatic($status,$reason);
125+
$result =newself($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
publicstaticfunctioncreate($timeout,$correlationId)
1414
{
15-
returnnewstatic(sprintf('Rpc call timeout is reached without receiving a reply message. Timeout: %s, CorrelationId: %s',$timeout,$correlationId));
15+
returnnewself(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
protectedfunctiongetSetupBrokerExtension(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
publicstaticfunctioncreate(string$moduleName,string$configName):self
2929
{
30-
returnnewstatic($moduleName,$configName);
30+
returnnewself($moduleName,$configName);
3131
}
3232

3333
publicfunctiongetModuleName():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-
returnnull;
159-
}
160-
161-
returnarray_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-
returnnull;
174-
}
175-
176-
returnarray_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 JsonSerializableObjectimplements \JsonSerializable
66
{
7-
publicfunctionjsonSerialize()
7+
#[\ReturnTypeWillChange]
8+
publicfunctionjsonSerialize():array
89
{
910
return ['foo' =>'fooVal'];
1011
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp