Skip to content

Commit e9575d7

Browse files
committed
Running php-cs-fixer
Running php-cs-fixer to fix CS drift
1 parent 11a357b commit e9575d7

File tree

9 files changed

+20
-29
lines changed

9 files changed

+20
-29
lines changed

SnsClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ private function resolveClient(): void
140140
}
141141
}
142142

143-
throw new \LogicException(sprintf('The input client must be an instance of "%s" or "%s" or a callable that returns one of those. Got "%s"', AwsSnsClient::class, MultiRegionClient::class, is_object($client) ? get_class($client) : gettype($client)));
143+
throw new \LogicException(sprintf('The input client must be an instance of "%s" or "%s" or a callable that returns one of those. Got "%s"', AwsSnsClient::class, MultiRegionClient::class, is_object($client) ? $client::class : gettype($client)));
144144
}
145145
}

SnsDestination.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getTopicName(): string
3434
/**
3535
* The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic.
3636
*/
37-
public function setPolicy(string $policy = null): void
37+
public function setPolicy(?string $policy = null): void
3838
{
3939
$this->setAttribute('Policy', $policy);
4040
}
@@ -47,7 +47,7 @@ public function getPolicy(): ?string
4747
/**
4848
* The display name to use for a topic with SMS subscriptions.
4949
*/
50-
public function setDisplayName(string $displayName = null): void
50+
public function setDisplayName(?string $displayName = null): void
5151
{
5252
$this->setAttribute('DisplayName', $displayName);
5353
}
@@ -60,7 +60,7 @@ public function getDisplayName(): ?string
6060
/**
6161
* The display name to use for a topic with SMS subscriptions.
6262
*/
63-
public function setDeliveryPolicy(int $deliveryPolicy = null): void
63+
public function setDeliveryPolicy(?int $deliveryPolicy = null): void
6464
{
6565
$this->setAttribute('DeliveryPolicy', $deliveryPolicy);
6666
}

SnsMessage.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public function __construct(
6363
string $body = '',
6464
array $properties = [],
6565
array $headers = [],
66-
array $messageAttributes = null,
67-
string $messageStructure = null,
68-
string $phoneNumber = null,
69-
string $subject = null,
70-
string $targetArn = null
66+
?array $messageAttributes = null,
67+
?string $messageStructure = null,
68+
?string $phoneNumber = null,
69+
?string $subject = null,
70+
?string $targetArn = null,
7171
) {
7272
$this->body = $body;
7373
$this->properties = $properties;
@@ -192,7 +192,7 @@ public function setTargetArn(?string $targetArn): void
192192
* of each user is processed in a FIFO fashion.
193193
* For more information, see: https://docs.aws.amazon.com/sns/latest/dg/fifo-message-grouping.html
194194
*/
195-
public function setMessageGroupId(string $id = null): void
195+
public function setMessageGroupId(?string $id = null): void
196196
{
197197
$this->messageGroupId = $id;
198198
}
@@ -210,7 +210,7 @@ public function getMessageGroupId(): ?string
210210
* aren't delivered during the 5-minute deduplication interval.
211211
* For more information, see https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html
212212
*/
213-
public function setMessageDeduplicationId(string $id = null): void
213+
public function setMessageDeduplicationId(?string $id = null): void
214214
{
215215
$this->messageDeduplicationId = $id;
216216
}

SnsProducer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function send(Destination $destination, Message $message): void
9999
*
100100
* @return SnsProducer
101101
*/
102-
public function setDeliveryDelay(int $deliveryDelay = null): Producer
102+
public function setDeliveryDelay(?int $deliveryDelay = null): Producer
103103
{
104104
if (null === $deliveryDelay) {
105105
return $this;
@@ -118,7 +118,7 @@ public function getDeliveryDelay(): ?int
118118
*
119119
* @return SnsProducer
120120
*/
121-
public function setPriority(int $priority = null): Producer
121+
public function setPriority(?int $priority = null): Producer
122122
{
123123
if (null === $priority) {
124124
return $this;
@@ -137,7 +137,7 @@ public function getPriority(): ?int
137137
*
138138
* @return SnsProducer
139139
*/
140-
public function setTimeToLive(int $timeToLive = null): Producer
140+
public function setTimeToLive(?int $timeToLive = null): Producer
141141
{
142142
if (null === $timeToLive) {
143143
return $this;

SnsSubscribe.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class SnsSubscribe
88
{
9-
const PROTOCOL_SQS = 'sqs';
9+
public const PROTOCOL_SQS = 'sqs';
1010

1111
/**
1212
* @var SnsDestination
@@ -23,22 +23,16 @@ class SnsSubscribe
2323
*/
2424
private $protocol;
2525

26-
/**
27-
* @var
28-
*/
2926
private $returnSubscriptionArn;
3027

31-
/**
32-
* @var
33-
*/
3428
private $attributes;
3529

3630
public function __construct(
3731
SnsDestination $topic,
3832
string $endpoint,
3933
string $protocol,
4034
bool $returnSubscriptionArn = false,
41-
array $attributes = []
35+
array $attributes = [],
4236
) {
4337
$this->topic = $topic;
4438
$this->endpoint = $endpoint;

SnsUnsubscribe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SnsUnsubscribe
2424
public function __construct(
2525
SnsDestination $topic,
2626
string $endpoint,
27-
string $protocol
27+
string $protocol,
2828
) {
2929
$this->topic = $topic;
3030
$this->endpoint = $endpoint;

Tests/SnsConnectionFactoryConfigTest.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
{

examples/consume.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if ($autoload) {
1313
require_once $autoload;
1414
} else {
15-
throw new \LogicException('Composer autoload was not found');
15+
throw new LogicException('Composer autoload was not found');
1616
}
1717

1818
use Enqueue\Sns\SnsConnectionFactory;
@@ -26,7 +26,7 @@
2626
while (true) {
2727
if ($m = $consumer->receive(20000)) {
2828
$consumer->acknowledge($m);
29-
echo 'Received message: '.$m->getBody().PHP_EOL;
29+
echo 'Received message: '.$m->getBody().\PHP_EOL;
3030
}
3131
}
3232

examples/produce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if ($autoload) {
1313
require_once $autoload;
1414
} else {
15-
throw new \LogicException('Composer autoload was not found');
15+
throw new LogicException('Composer autoload was not found');
1616
}
1717

1818
use Enqueue\Sns\SnsConnectionFactory;

0 commit comments

Comments
 (0)