Skip to content

Commit a287989

Browse files
committed
Prefix all sprintf() calls
1 parent 4c66670 commit a287989

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

LinkedInTransport.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343

4444
public function __toString(): string
4545
{
46-
return sprintf('linkedin://%s', $this->getEndpoint());
46+
return \sprintf('linkedin://%s', $this->getEndpoint());
4747
}
4848

4949
public function supports(MessageInterface $message): bool
@@ -61,15 +61,15 @@ protected function doSend(MessageInterface $message): SentMessage
6161
}
6262

6363
if (($options = $message->getOptions()) && !$options instanceof LinkedInOptions) {
64-
throw new LogicException(sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, LinkedInOptions::class));
64+
throw new LogicException(\sprintf('The "%s" transport only supports instances of "%s" for options.', __CLASS__, LinkedInOptions::class));
6565
}
6666

6767
if (!$options && $notification = $message->getNotification()) {
6868
$options = LinkedInOptions::fromNotification($notification);
6969
$options->author(new AuthorShare($this->accountId));
7070
}
7171

72-
$endpoint = sprintf('https://%s/v2/ugcPosts', $this->getEndpoint());
72+
$endpoint = \sprintf('https://%s/v2/ugcPosts', $this->getEndpoint());
7373

7474
$response = $this->client->request('POST', $endpoint, [
7575
'auth_bearer' => $this->authToken,
@@ -84,13 +84,13 @@ protected function doSend(MessageInterface $message): SentMessage
8484
}
8585

8686
if (201 !== $statusCode) {
87-
throw new TransportException(sprintf('Unable to post the Linkedin message: "%s".', $response->getContent(false)), $response);
87+
throw new TransportException(\sprintf('Unable to post the Linkedin message: "%s".', $response->getContent(false)), $response);
8888
}
8989

9090
$result = $response->toArray(false);
9191

9292
if (!$result['id']) {
93-
throw new TransportException(sprintf('Unable to post the Linkedin message: "%s".', $result['error']), $response);
93+
throw new TransportException(\sprintf('Unable to post the Linkedin message: "%s".', $result['error']), $response);
9494
}
9595

9696
$sentMessage = new SentMessage($message, (string) $this);
@@ -115,7 +115,7 @@ private function bodyFromMessageWithNoOption(MessageInterface $message): array
115115
'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC',
116116
],
117117
'lifecycleState' => 'PUBLISHED',
118-
'author' => sprintf('urn:li:person:%s', $this->accountId),
118+
'author' => \sprintf('urn:li:person:%s', $this->accountId),
119119
];
120120
}
121121
}

Share/LifecycleStateShare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class LifecycleStateShare extends AbstractLinkedInShare
4141
public function __construct(string $lifecycleState = self::PUBLISHED)
4242
{
4343
if (!\in_array($lifecycleState, self::AVAILABLE_LIFECYCLE, true)) {
44-
throw new LogicException(sprintf('"%s" is not a valid value, available lifecycle are "%s".', $lifecycleState, implode(', ', self::AVAILABLE_LIFECYCLE)));
44+
throw new LogicException(\sprintf('"%s" is not a valid value, available lifecycle are "%s".', $lifecycleState, implode(', ', self::AVAILABLE_LIFECYCLE)));
4545
}
4646

4747
$this->lifecycleState = $lifecycleState;

Share/ShareContentShare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct(string $text, array $attributes = [], ?string $infer
7373

7474
if ($shareMediaCategory) {
7575
if (!\in_array($shareMediaCategory, self::ALL, true)) {
76-
throw new LogicException(sprintf('"%s" is not valid option, available options are "%s".', $shareMediaCategory, implode(', ', self::ALL)));
76+
throw new LogicException(\sprintf('"%s" is not valid option, available options are "%s".', $shareMediaCategory, implode(', ', self::ALL)));
7777
}
7878

7979
$this->options['shareMediaCategory'] = $shareMediaCategory;

Share/ShareMediaShare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(string $text, array $attributes = [], ?string $infer
5555

5656
if (null !== $landingPageTitle) {
5757
if (!\in_array($landingPageTitle, self::ALL, true)) {
58-
throw new LogicException(sprintf('"%s" is not valid option, available options are "%s".', $landingPageTitle, implode(', ', self::ALL)));
58+
throw new LogicException(\sprintf('"%s" is not valid option, available options are "%s".', $landingPageTitle, implode(', ', self::ALL)));
5959
}
6060

6161
$this->options['landingPage']['landingPageTitle'] = $landingPageTitle;

Share/VisibilityShare.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ final class VisibilityShare extends AbstractLinkedInShare
4040
public function __construct(string $visibility = self::MEMBER_NETWORK_VISIBILITY, string $value = 'PUBLIC')
4141
{
4242
if (!\in_array($visibility, self::AVAILABLE_VISIBILITY, true)) {
43-
throw new LogicException(sprintf('"%s" is not a valid visibility, available visibility are "%s".', $visibility, implode(', ', self::AVAILABLE_VISIBILITY)));
43+
throw new LogicException(\sprintf('"%s" is not a valid visibility, available visibility are "%s".', $visibility, implode(', ', self::AVAILABLE_VISIBILITY)));
4444
}
4545

4646
if (self::MEMBER_NETWORK_VISIBILITY === $visibility && !\in_array($value, self::MEMBER_NETWORK, true)) {
47-
throw new LogicException(sprintf('"%s" is not a valid value, available value for visibility "%s" are "%s".', $value, $visibility, implode(', ', self::MEMBER_NETWORK)));
47+
throw new LogicException(\sprintf('"%s" is not a valid value, available value for visibility "%s" are "%s".', $value, $visibility, implode(', ', self::MEMBER_NETWORK)));
4848
}
4949

5050
if (self::SPONSORED_CONTENT_VISIBILITY === $visibility && self::DARK !== $value) {
51-
throw new LogicException(sprintf('"%s" is not a valid value, available value for visibility "%s" is "%s".', $value, $visibility, self::DARK));
51+
throw new LogicException(\sprintf('"%s" is not a valid value, available value for visibility "%s" is "%s".', $value, $visibility, self::DARK));
5252
}
5353

5454
$this->options['com.linkedin.ugc.'.$visibility] = $value;

0 commit comments

Comments
 (0)