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

Commit 8b16dbc

Browse files
committed
Running php-cs-fixer
Running php-cs-fixer to fix CS drift
1 parent e9fdc3a commit 8b16dbc

13 files changed

+13
-63
lines changed

‎PheanstalkMessage.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function setRedelivered(bool $redelivered): void
103103
$this->redelivered = $redelivered;
104104
}
105105

106-
public function setCorrelationId(string $correlationId = null): void
106+
public function setCorrelationId(?string $correlationId = null): void
107107
{
108108
$this->setHeader('correlation_id', (string) $correlationId);
109109
}
@@ -113,7 +113,7 @@ public function getCorrelationId(): ?string
113113
return $this->getHeader('correlation_id');
114114
}
115115

116-
public function setMessageId(string $messageId = null): void
116+
public function setMessageId(?string $messageId = null): void
117117
{
118118
$this->setHeader('message_id', (string) $messageId);
119119
}
@@ -130,12 +130,12 @@ public function getTimestamp(): ?int
130130
return null === $value ? null : (int) $value;
131131
}
132132

133-
public function setTimestamp(int $timestamp = null): void
133+
public function setTimestamp(?int $timestamp = null): void
134134
{
135135
$this->setHeader('timestamp', $timestamp);
136136
}
137137

138-
public function setReplyTo(string $replyTo = null): void
138+
public function setReplyTo(?string $replyTo = null): void
139139
{
140140
$this->setHeader('reply_to', $replyTo);
141141
}
@@ -187,12 +187,8 @@ public function jsonSerialize(): array
187187
public static function jsonUnserialize(string $json): self
188188
{
189189
$data = json_decode($json, true);
190-
if (JSON_ERROR_NONE !== json_last_error()) {
191-
throw new \InvalidArgumentException(sprintf(
192-
'The malformed json given. Error %s and message %s',
193-
json_last_error(),
194-
json_last_error_msg()
195-
));
190+
if (\JSON_ERROR_NONE !== json_last_error()) {
191+
throw new \InvalidArgumentException(sprintf('The malformed json given. Error %s and message %s', json_last_error(), json_last_error_msg()));
196192
}
197193

198194
return new self($data['body'], $data['properties'], $data['headers']);
@@ -203,7 +199,7 @@ public function getJob(): ?Job
203199
return $this->job;
204200
}
205201

206-
public function setJob(Job $job = null): void
202+
public function setJob(?Job $job = null): void
207203
{
208204
$this->job = $job;
209205
}

‎PheanstalkProducer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function send(Destination $destination, Message $message): void
4848
InvalidMessageException::assertMessageInstanceOf($message, PheanstalkMessage::class);
4949

5050
$rawMessage = json_encode($message);
51-
if (JSON_ERROR_NONE !== json_last_error()) {
51+
if (\JSON_ERROR_NONE !== json_last_error()) {
5252
throw new \InvalidArgumentException(sprintf('Could not encode value into json. Error %s and message %s', json_last_error(), json_last_error_msg()));
5353
}
5454

@@ -73,7 +73,7 @@ public function send(Destination $destination, Message $message): void
7373
/**
7474
* @return PheanstalkProducer
7575
*/
76-
public function setDeliveryDelay(int $deliveryDelay = null): Producer
76+
public function setDeliveryDelay(?int $deliveryDelay = null): Producer
7777
{
7878
$this->deliveryDelay = $deliveryDelay;
7979

@@ -88,7 +88,7 @@ public function getDeliveryDelay(): ?int
8888
/**
8989
* @return PheanstalkProducer
9090
*/
91-
public function setPriority(int $priority = null): Producer
91+
public function setPriority(?int $priority = null): Producer
9292
{
9393
$this->priority = $priority;
9494

@@ -103,7 +103,7 @@ public function getPriority(): ?int
103103
/**
104104
* @return PheanstalkProducer
105105
*/
106-
public function setTimeToLive(int $timeToLive = null): Producer
106+
public function setTimeToLive(?int $timeToLive = null): Producer
107107
{
108108
$this->timeToLive = $timeToLive;
109109

‎Tests/PheanstalkConnectionFactoryConfigTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public function testThrowIfDsnCouldNotBeParsed()
4141

4242
/**
4343
* @dataProvider provideConfigs
44-
*
45-
* @param mixed $config
46-
* @param mixed $expectedConfig
4744
*/
4845
public function testShouldParseConfigurationAsExpected($config, $expectedConfig)
4946
{

‎Tests/PheanstalkConsumerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testShouldReceiveFromQueueAndReturnNullIfNoMessageInQueue()
4646
public function testShouldReceiveFromQueueAndReturnMessageIfMessageInQueue()
4747
{
4848
$destination = new PheanstalkDestination('theQueueName');
49-
$message = new PheanstalkMessage('theBody', ['foo' => 'fooVal'], ['bar' => 'barVal']);
49+
$message = new PheanstalkMessage('theBody', ['foo' => 'fooVal'], ['bar' => 'barVal']);
5050

5151
$job = new Job('theJobId', json_encode($message));
5252

‎Tests/Spec/PheanstalkConnectionFactoryTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class PheanstalkConnectionFactoryTest extends ConnectionFactorySpec
99
{
10-
/**
11-
* {@inheritdoc}
12-
*/
1310
protected function createConnectionFactory()
1411
{
1512
return new PheanstalkConnectionFactory();

‎Tests/Spec/PheanstalkContextTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
class PheanstalkContextTest extends ContextSpec
1010
{
11-
/**
12-
* {@inheritdoc}
13-
*/
1411
protected function createContext()
1512
{
1613
return new PheanstalkContext($this->createMock(Pheanstalk::class));

‎Tests/Spec/PheanstalkMessageTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class PheanstalkMessageTest extends MessageSpec
99
{
10-
/**
11-
* {@inheritdoc}
12-
*/
1310
protected function createMessage()
1411
{
1512
return new PheanstalkMessage();

‎Tests/Spec/PheanstalkQueueTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class PheanstalkQueueTest extends QueueSpec
99
{
10-
/**
11-
* {@inheritdoc}
12-
*/
1310
protected function createQueue()
1411
{
1512
return new PheanstalkDestination(self::EXPECTED_QUEUE_NAME);

‎Tests/Spec/PheanstalkSendToAndReceiveFromQueueTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
class PheanstalkSendToAndReceiveFromQueueTest extends SendToAndReceiveFromQueueSpec
1414
{
15-
/**
16-
* {@inheritdoc}
17-
*/
1815
protected function createContext()
1916
{
2017
$factory = new PheanstalkConnectionFactory(getenv('BEANSTALKD_DSN'));
@@ -23,8 +20,7 @@ protected function createContext()
2320
}
2421

2522
/**
26-
* @param Context $context
27-
* @param string $queueName
23+
* @param string $queueName
2824
*
2925
* @return Queue
3026
*/

‎Tests/Spec/PheanstalkSendToAndReceiveNoWaitFromQueueTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@
1111
*/
1212
class PheanstalkSendToAndReceiveNoWaitFromQueueTest extends SendToAndReceiveNoWaitFromQueueSpec
1313
{
14-
/**
15-
* {@inheritdoc}
16-
*/
1714
protected function createContext()
1815
{
1916
$factory = new PheanstalkConnectionFactory(getenv('BEANSTALKD_DSN'));
2017

2118
return $factory->createContext();
2219
}
2320

24-
/**
25-
* {@inheritdoc}
26-
*/
2721
protected function createQueue(Context $context, $queueName)
2822
{
2923
return $context->createQueue($queueName.time());

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /