GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( 0ba900...044f0b )
by Carlos
01:08
created
src/EasySms.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@
 block discarded – undo
267 267
 
268 268
         $name = \ucfirst(\str_replace(['-', '_', ''], '', $name));
269 269
 
270
-        return __NAMESPACE__."\\Gateways\\{$name}Gateway";
270
+        return __NAMESPACE__."\\Gateways\\{$name}gateway";
271 271
     }
272 272
 
273 273
     /**
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @throws NoGatewayAvailableException
54 54
      * @throws InvalidArgumentException
55 55
      */
56
-    public function send(array|string $to, MessageInterface|array $message, array $gateways = []): array
56
+    public function send(array | string $to, MessageInterface | array $message, array $gateways = []): array
57 57
     {
58 58
         $to = $this->formatPhoneNumber($to);
59 59
         $message = $this->formatMessage($message);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function gateway(?string $name): GatewayInterface
75 75
     {
76
-        if (! isset($this->gateways[$name])) {
76
+        if (!isset($this->gateways[$name])) {
77 77
             $this->gateways[$name] = $this->createGateway($name);
78 78
         }
79 79
 
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
             $strategy = $this->config->get('default.strategy', OrderStrategy::class);
92 92
         }
93 93
 
94
-        if (! \class_exists($strategy)) {
94
+        if (!\class_exists($strategy)) {
95 95
             $strategy = __NAMESPACE__.'\Strategies\\'.\ucfirst($strategy);
96 96
         }
97 97
 
98
-        if (! \class_exists($strategy)) {
98
+        if (!\class_exists($strategy)) {
99 99
             throw new InvalidArgumentException("Unsupported strategy \"{$strategy}\"");
100 100
         }
101 101
 
102
-        if (empty($this->strategies[$strategy]) || ! ($this->strategies[$strategy] instanceof StrategyInterface)) {
102
+        if (empty($this->strategies[$strategy]) || !($this->strategies[$strategy] instanceof StrategyInterface)) {
103 103
             $this->strategies[$strategy] = new $strategy($this);
104 104
         }
105 105
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $config = $this->config->get("gateways.{$name}", []);
140 140
 
141
-        if (! isset($config['timeout'])) {
141
+        if (!isset($config['timeout'])) {
142 142
             $config['timeout'] = $this->config->get('timeout', Gateway::DEFAULT_TIMEOUT);
143 143
         }
144 144
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             $gateway = $this->makeGateway($className, $config);
152 152
         }
153 153
 
154
-        if (! ($gateway instanceof GatewayInterface)) {
154
+        if (!($gateway instanceof GatewayInterface)) {
155 155
             throw new InvalidArgumentException(\sprintf('Gateway "%s" must implement interface %s.', $name, GatewayInterface::class));
156 156
         }
157 157
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     protected function makeGateway(string $gateway, array $config): GatewayInterface
167 167
     {
168
-        if (! \class_exists($gateway) || ! \in_array(GatewayInterface::class, \class_implements($gateway))) {
168
+        if (!\class_exists($gateway) || !\in_array(GatewayInterface::class, \class_implements($gateway))) {
169 169
             throw new InvalidArgumentException(\sprintf('Class "%s" is a invalid easy-sms gateway.', $gateway));
170 170
         }
171 171
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         return \call_user_func($this->customCreators[$gateway], $config);
195 195
     }
196 196
 
197
-    protected function formatPhoneNumber(PhoneNumberInterface|string $number): PhoneNumberInterface
197
+    protected function formatPhoneNumber(PhoneNumberInterface | string $number): PhoneNumberInterface
198 198
     {
199 199
         if ($number instanceof PhoneNumberInterface) {
200 200
             return $number;
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
         return new PhoneNumber(\trim($number));
204 204
     }
205 205
 
206
-    protected function formatMessage(MessageInterface|array|string $message): MessageInterface
206
+    protected function formatMessage(MessageInterface | array | string $message): MessageInterface
207 207
     {
208
-        if (! ($message instanceof MessageInterface)) {
209
-            if (! \is_array($message)) {
208
+        if (!($message instanceof MessageInterface)) {
209
+            if (!\is_array($message)) {
210 210
                 $message = [
211 211
                     'content' => $message,
212 212
                     'template' => $message,
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             $formatted[$gateway] = $setting;
236 236
             $globalSettings = $this->config->get("gateways.{$gateway}", []);
237 237
 
238
-            if (\is_string($gateway) && ! empty($globalSettings) && \is_array($setting)) {
238
+            if (\is_string($gateway) && !empty($globalSettings) && \is_array($setting)) {
239 239
                 $formatted[$gateway] = new Config(\array_merge($globalSettings, $setting));
240 240
             }
241 241
         }
Please login to merge, or discard this patch.
src/Exceptions/InvalidArgumentException.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,4 +14,6 @@
 block discarded – undo
14 14
 /**
15 15
  * Class InvalidArgumentException.
16 16
  */
17
-class InvalidArgumentException extends Exception {}
17
+class InvalidArgumentException extends Exception
18
+{
19
+}
Please login to merge, or discard this patch.
src/Gateways/SubmailGateway.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
             $params = [
54 54
                 'appid' => $config->get('app_id'),
55 55
                 'signature' => $config->get('app_key'),
56
-                'project' => ! empty($template_code) ? $template_code : (! empty($data['project']) ? $data['project'] : $config->get('project')),
56
+                'project' => !empty($template_code) ? $template_code : (!empty($data['project']) ? $data['project'] : $config->get('project')),
57 57
                 'to' => $to->getUniversalNumber(),
58 58
                 'vars' => json_encode($data, JSON_FORCE_OBJECT),
59 59
             ];
Please login to merge, or discard this patch.
src/Gateways/SendcloudGateway.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 
54 54
         $result = $this->post(sprintf(self::ENDPOINT_TEMPLATE, 'send'), $params);
55 55
 
56
-        if (! $result['result']) {
56
+        if (!$result['result']) {
57 57
             throw new GatewayErrorException($result['message'], $result['statusCode'], $result);
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/Gateways/VolcengineGateway.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
     public function send(PhoneNumberInterface $to, MessageInterface $message, Config $config)
61 61
     {
62 62
         $data = $message->getData($this);
63
-        $signName = ! empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
64
-        $smsAccount = ! empty($data['sms_account']) ? $data['sms_account'] : $config->get('sms_account');
63
+        $signName = !empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
64
+        $smsAccount = !empty($data['sms_account']) ? $data['sms_account'] : $config->get('sms_account');
65 65
         $templateId = $message->getTemplate($this);
66
-        $phoneNumbers = ! empty($data['phone_numbers']) ? $data['phone_numbers'] : $to->getNumber();
67
-        $templateParam = ! empty($data['template_param']) ? $data['template_param'] : $message->getData($this);
66
+        $phoneNumbers = !empty($data['phone_numbers']) ? $data['phone_numbers'] : $to->getNumber();
67
+        $templateParam = !empty($data['template_param']) ? $data['template_param'] : $message->getData($this);
68 68
 
69
-        $tag = ! empty($data['tag']) ? $data['tag'] : '';
69
+        $tag = !empty($data['tag']) ? $data['tag'] : '';
70 70
 
71 71
         $payload = [
72 72
             'SmsAccount' => $smsAccount, // 消息组帐号,火山短信页面右上角,短信应用括号中的字符串
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     public function getEndpoint()
200 200
     {
201 201
         $regionId = $this->getRegionId();
202
-        if (! in_array($regionId, array_keys(self::$endpoints))) {
202
+        if (!in_array($regionId, array_keys(self::$endpoints))) {
203 203
             $regionId = self::ENDPOINT_DEFAULT_REGION_ID;
204 204
         }
205 205
 
Please login to merge, or discard this patch.
src/Gateways/AliyunGateway.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $data = $message->getData($this);
53 53
 
54
-        $signName = ! empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
54
+        $signName = !empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
55 55
 
56 56
         unset($data['sign_name']);
57 57
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             'Timestamp' => gmdate('Y-m-d\TH:i:s\Z'),
66 66
             'Action' => self::ENDPOINT_METHOD,
67 67
             'Version' => self::ENDPOINT_VERSION,
68
-            'PhoneNumbers' => ! \is_null($to->getIDDCode()) ? strval($to->getZeroPrefixedNumber()) : $to->getNumber(),
68
+            'PhoneNumbers' => !\is_null($to->getIDDCode()) ? strval($to->getZeroPrefixedNumber()) : $to->getNumber(),
69 69
             'SignName' => $signName,
70 70
             'TemplateCode' => $message->getTemplate($this),
71 71
             'TemplateParam' => json_encode($data, JSON_FORCE_OBJECT),
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         $result = $this->get(self::ENDPOINT_URL, $params);
77 77
 
78
-        if (! empty($result['Code']) && $result['Code'] != 'OK') {
78
+        if (!empty($result['Code']) && $result['Code'] != 'OK') {
79 79
             throw new GatewayErrorException($result['Message'], $result['Code'], $result);
80 80
         }
81 81
 
Please login to merge, or discard this patch.
src/Gateways/YunpianGateway.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             'exceptions' => false,
50 50
         ];
51 51
 
52
-        if (! is_null($template)) {
52
+        if (!is_null($template)) {
53 53
             $function = 'tpl_single_send';
54 54
             $data = [];
55 55
 
Please login to merge, or discard this patch.
src/Gateways/QiniuGateway.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             'mobile' => $to->getNumber(),
47 47
         ];
48 48
 
49
-        if (! empty($data)) {
49
+        if (!empty($data)) {
50 50
             $params['parameters'] = $data;
51 51
         }
52 52
 
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
         }
104 104
         // write request uri
105 105
         $toSignStr = $method.' '.$path;
106
-        if (! empty($query)) {
106
+        if (!empty($query)) {
107 107
             $toSignStr .= '?'.$query;
108 108
         }
109 109
         // write host and port
110 110
         $toSignStr .= "\nHost: ".$host;
111
-        if (! empty($port)) {
111
+        if (!empty($port)) {
112 112
             $toSignStr .= ':'.$port;
113 113
         }
114 114
         // write content type
115
-        if (! empty($contentType)) {
115
+        if (!empty($contentType)) {
116 116
             $toSignStr .= "\nContent-Type: ".$contentType;
117 117
         }
118 118
         $toSignStr .= "\n\n";
119 119
         // write body
120
-        if (! empty($body)) {
120
+        if (!empty($body)) {
121 121
             $toSignStr .= $body;
122 122
         }
123 123
 
Please login to merge, or discard this patch.
src/Gateways/AliyunIntlGateway.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $data = $message->getData($this);
42 42
 
43
-        $signName = ! empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
43
+        $signName = !empty($data['sign_name']) ? $data['sign_name'] : $config->get('sign_name');
44 44
 
45 45
         unset($data['sign_name']);
46 46
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             'SignatureNonce' => uniqid('', true),
54 54
             'Timestamp' => gmdate('Y-m-d\TH:i:s\Z'),
55 55
             'Version' => self::ENDPOINT_VERSION,
56
-            'To' => ! \is_null($to->getIDDCode()) ? (int) $to->getZeroPrefixedNumber() : $to->getNumber(),
56
+            'To' => !\is_null($to->getIDDCode()) ? (int) $to->getZeroPrefixedNumber() : $to->getNumber(),
57 57
             'Action' => self::ENDPOINT_ACTION,
58 58
             'From' => $signName,
59 59
             'TemplateCode' => $message->getTemplate($this),
Please login to merge, or discard this patch.