Skip to content

Commit 8759f4f

Browse files
committed
Added Pint and fixed PHP syntax
1 parent 4abe9b0 commit 8759f4f

15 files changed

+48
-98
lines changed

pint.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"blank_line_before_statement": false,
5+
"binary_operator_spaces": false,
6+
"phpdoc_separation": false,
7+
"modernize_strpos": true
8+
},
9+
"exclude": [
10+
"node_modules"
11+
],
12+
"cache-file": ".pint.cache.json"
13+
}

src/Twilio.php

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public function __construct(TwilioService $twilioService, TwilioConfig $config)
2525
/**
2626
* Send a TwilioMessage to the a phone number.
2727
*
28-
* @param TwilioMessage $message
29-
* @param string|null $to
30-
* @param bool $useAlphanumericSender
3128
*
3229
* @return mixed
3330
* @throws TwilioException
@@ -53,18 +50,15 @@ public function sendMessage(TwilioMessage $message, ?string $to, bool $useAlphan
5350
/**
5451
* Send an sms message using the Twilio Service.
5552
*
56-
* @param TwilioSmsMessage $message
57-
* @param string|null $to
5853
*
59-
* @return MessageInstance
6054
* @throws CouldNotSendNotification
6155
* @throws TwilioException
6256
*/
6357
protected function sendSmsMessage(TwilioSmsMessage $message, ?string $to): MessageInstance
6458
{
6559
$debugTo = $this->config->getDebugTo();
6660

67-
if (!empty($debugTo)) {
61+
if (! empty($debugTo)) {
6862
$to = $debugTo;
6963
}
7064

@@ -77,7 +71,7 @@ protected function sendSmsMessage(TwilioSmsMessage $message, ?string $to): Messa
7771
}
7872

7973
if ($this->config->isShortenUrlsEnabled()) {
80-
$params['ShortenUrls'] = "true";
74+
$params['ShortenUrls'] = 'true';
8175
}
8276

8377
if ($from = $this->getFrom($message)) {
@@ -110,10 +104,7 @@ protected function sendSmsMessage(TwilioSmsMessage $message, ?string $to): Messa
110104
/**
111105
* Make a call using the Twilio Service.
112106
*
113-
* @param TwilioCallMessage $message
114-
* @param string|null $to
115107
*
116-
* @return CallInstance
117108
* @throws TwilioException
118109
* @throws CouldNotSendNotification
119110
*/
@@ -151,9 +142,6 @@ protected function makeCall(TwilioCallMessage $message, ?string $to): CallInstan
151142

152143
/**
153144
* Get the from address from message, or config.
154-
*
155-
* @param TwilioMessage $message
156-
* @return string|null
157145
*/
158146
protected function getFrom(TwilioMessage $message): ?string
159147
{
@@ -162,9 +150,6 @@ protected function getFrom(TwilioMessage $message): ?string
162150

163151
/**
164152
* Get the messaging service SID from message, or config.
165-
*
166-
* @param TwilioSmsMessage $message
167-
* @return string|null
168153
*/
169154
protected function getMessagingServiceSid(TwilioSmsMessage $message): ?string
170155
{
@@ -173,19 +158,16 @@ protected function getMessagingServiceSid(TwilioSmsMessage $message): ?string
173158

174159
/**
175160
* Get the alphanumeric sender from config, if one exists.
176-
*
177-
* @return string|null
178161
*/
179162
protected function getAlphanumericSender(): ?string
180163
{
181164
return $this->config->getAlphanumericSender();
182165
}
183166

184167
/**
185-
* @param array $params
186-
* @param TwilioMessage $message
187-
* @param array $optionalParams
188-
* @return Twilio
168+
* @param array $params
169+
* @param TwilioMessage $message
170+
* @param array $optionalParams
189171
*/
190172
protected function fillOptionalParams(&$params, $message, $optionalParams): self
191173
{

src/TwilioCallMessage.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class TwilioCallMessage extends TwilioMessage
66
{
77
public const STATUS_CANCELED = 'canceled';
8+
89
public const STATUS_COMPLETED = 'completed';
910

1011
/**
@@ -30,7 +31,6 @@ class TwilioCallMessage extends TwilioMessage
3031
/**
3132
* Set the message url.
3233
*
33-
* @param string $url
3434
* @return $this
3535
*/
3636
public function url(string $url): self
@@ -43,7 +43,7 @@ public function url(string $url): self
4343
/**
4444
* Set the message url request method.
4545
*
46-
* @param string $method
46+
* @param string $method
4747
* @return $this
4848
*/
4949
public function method($method): self
@@ -56,7 +56,6 @@ public function method($method): self
5656
/**
5757
* Set the status for the current calls.
5858
*
59-
* @param string $status
6059
* @return $this
6160
*/
6261
public function status(string $status): self
@@ -69,7 +68,6 @@ public function status(string $status): self
6968
/**
7069
* Set the fallback url.
7170
*
72-
* @param string $fallbackUrl
7371
* @return $this
7472
*/
7573
public function fallbackUrl(string $fallbackUrl): self
@@ -82,7 +80,6 @@ public function fallbackUrl(string $fallbackUrl): self
8280
/**
8381
* Set the fallback url request method.
8482
*
85-
* @param string $fallbackMethod
8683
* @return $this
8784
*/
8885
public function fallbackMethod(string $fallbackMethod): self

src/TwilioChannel.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class TwilioChannel
2222

2323
/**
2424
* TwilioChannel constructor.
25-
*
26-
* @param Twilio $twilio
27-
* @param Dispatcher $events
2825
*/
2926
public function __construct(Twilio $twilio, Dispatcher $events)
3027
{
@@ -35,8 +32,7 @@ public function __construct(Twilio $twilio, Dispatcher $events)
3532
/**
3633
* Send the given notification.
3734
*
38-
* @param mixed $notifiable
39-
* @param Notification $notification
35+
* @param mixed $notifiable
4036
*
4137
* @return mixed
4238
* @throws Exception
@@ -82,8 +78,7 @@ public function send($notifiable, Notification $notification)
8278
/**
8379
* Get the message to send.
8480
*
85-
* @param mixed $notifiable
86-
* @param Notification $notification
81+
* @param mixed $notifiable
8782
*
8883
* @return mixed
8984
*/
@@ -109,8 +104,8 @@ protected function isEnabled()
109104
/**
110105
* Get the address to send a notification to.
111106
*
112-
* @param mixed $notifiable
113-
* @param Notification|null $notification
107+
* @param mixed $notifiable
108+
* @param Notification|null $notification
114109
*
115110
* @return mixed
116111
* @throws CouldNotSendNotification
@@ -133,7 +128,6 @@ protected function getTo($notifiable, $notification = null)
133128
/**
134129
* Get the alphanumeric sender.
135130
*
136-
* @param $notifiable
137131
*
138132
* @return mixed|null
139133
* @throws CouldNotSendNotification

src/TwilioConfig.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ class TwilioConfig
77
/** @var array */
88
private $config;
99

10-
/**
11-
* @param array $config
12-
*/
1310
public function __construct(array $config)
1411
{
1512
$this->config = $config;

src/TwilioMessage.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ abstract class TwilioMessage
3030

3131
/**
3232
* Create a message object.
33-
* @param string $content
3433
* @return static
3534
*/
3635
public static function create(string $content = ''): self
@@ -40,8 +39,6 @@ public static function create(string $content = ''): self
4039

4140
/**
4241
* Create a new message instance.
43-
*
44-
* @param string $content
4542
*/
4643
public function __construct(string $content = '')
4744
{
@@ -51,7 +48,6 @@ public function __construct(string $content = '')
5148
/**
5249
* Set the message content.
5350
*
54-
* @param string $content
5551
* @return $this
5652
*/
5753
public function content(string $content): self
@@ -64,7 +60,6 @@ public function content(string $content): self
6460
/**
6561
* Set the phone number the message should be sent from.
6662
*
67-
* @param string $from
6863
* @return $this
6964
*/
7065
public function from(string $from): self
@@ -76,8 +71,6 @@ public function from(string $from): self
7671

7772
/**
7873
* Get the from address.
79-
*
80-
* @return string|null
8174
*/
8275
public function getFrom(): ?string
8376
{
@@ -87,7 +80,6 @@ public function getFrom(): ?string
8780
/**
8881
* Set the status callback.
8982
*
90-
* @param string $statusCallback
9183
* @return $this
9284
*/
9385
public function statusCallback(string $statusCallback): self
@@ -100,7 +92,6 @@ public function statusCallback(string $statusCallback): self
10092
/**
10193
* Set the status callback request method.
10294
*
103-
* @param string $statusCallbackMethod
10495
* @return $this
10596
*/
10697
public function statusCallbackMethod(string $statusCallbackMethod): self

src/TwilioMmsMessage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class TwilioMmsMessage extends TwilioSmsMessage
1212
/**
1313
* Set the message media url.
1414
*
15-
* @param string $url
1615
* @return $this
1716
*/
1817
public function mediaUrl(string $url): self

src/TwilioProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class TwilioProvider extends ServiceProvider implements DeferrableProvider
1414
/**
1515
* Bootstrap the application services.
1616
*/
17-
public function boot()
18-
{
19-
}
17+
public function boot() {}
2018

2119
/**
2220
* Register the application services.
@@ -65,8 +63,6 @@ public function register()
6563

6664
/**
6765
* Get the services provided by the provider.
68-
*
69-
* @return array
7066
*/
7167
public function provides(): array
7268
{

src/TwilioSmsMessage.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class TwilioSmsMessage extends TwilioMessage
4141

4242
/**
4343
* Get the from address of this message.
44-
*
45-
* @return null|string
4644
*/
4745
public function getFrom(): ?string
4846
{
@@ -60,7 +58,6 @@ public function getFrom(): ?string
6058
/**
6159
* Set the messaging service SID.
6260
*
63-
* @param string $messagingServiceSid
6461
* @return $this
6562
*/
6663
public function messagingServiceSid(string $messagingServiceSid): self
@@ -72,8 +69,6 @@ public function messagingServiceSid(string $messagingServiceSid): self
7269

7370
/**
7471
* Get the messaging service SID of this message.
75-
*
76-
* @return null|string
7772
*/
7873
public function getMessagingServiceSid(): ?string
7974
{
@@ -83,7 +78,6 @@ public function getMessagingServiceSid(): ?string
8378
/**
8479
* Set the alphanumeric sender.
8580
*
86-
* @param string $sender
8781
* @return $this
8882
*/
8983
public function sender(string $sender): self
@@ -96,7 +90,6 @@ public function sender(string $sender): self
9690
/**
9791
* Set application SID for the message status callback.
9892
*
99-
* @param string $applicationSid
10093
* @return $this
10194
*/
10295
public function applicationSid(string $applicationSid): self
@@ -109,7 +102,6 @@ public function applicationSid(string $applicationSid): self
109102
/**
110103
* Set force delivery (Deliver message without validation).
111104
*
112-
* @param bool $forceDelivery
113105
* @return $this
114106
*/
115107
public function forceDelivery(bool $forceDelivery): self
@@ -122,7 +114,6 @@ public function forceDelivery(bool $forceDelivery): self
122114
/**
123115
* Set the max price (in USD dollars).
124116
*
125-
* @param float $maxPrice
126117
* @return $this
127118
*/
128119
public function maxPrice(float $maxPrice): self
@@ -135,7 +126,6 @@ public function maxPrice(float $maxPrice): self
135126
/**
136127
* Set the provide feedback option.
137128
*
138-
* @param bool $provideFeedback
139129
* @return $this
140130
*/
141131
public function provideFeedback(bool $provideFeedback): self
@@ -148,7 +138,6 @@ public function provideFeedback(bool $provideFeedback): self
148138
/**
149139
* Set the validity period (in seconds).
150140
*
151-
* @param int $validityPeriodSeconds
152141
*
153142
* @return $this
154143
*/

0 commit comments

Comments
 (0)