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 ( 9d889d...27a869 )
by Carlos
02:09
created

ErrorlogGateway   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 30
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3
ccs 8
cts 12
cp 0.6667
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 20 2
1
<?php
2
3
/*
4
 * This file is part of the overtrue/easy-sms.
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Overtrue\EasySms\Gateways;
13
14
use Overtrue\EasySms\Contracts\MessageInterface;
15
use Overtrue\EasySms\Contracts\PhoneNumberInterface;
16
use Overtrue\EasySms\Support\Config;
17
18
/**
19
 * Class ErrorlogGateway.
20
 */
21
class ErrorlogGateway extends Gateway
22
{
23
    /**
24
     * @param \Overtrue\EasySms\Contracts\PhoneNumberInterface $to
25
     * @param \Overtrue\EasySms\Contracts\MessageInterface     $message
26
     * @param \Overtrue\EasySms\Support\Config                 $config
27
     *
28
     * @return array
29
     */
30
    public function send(PhoneNumberInterface $to, MessageInterface $message, Config $config)
31
    {
32
        if (is_array($to)) {
33
            $to = implode(',', $to);
34
        }
35
36
        $message = sprintf(
37
            "[%s] to: %s | message: \"%s\"  | template: \"%s\" | data: %s\n",
38
            date('Y-m-d H:i:s'),
39 1
            $to,
40
            $message->getContent($this),
41 1
            $message->getTemplate($this),
42
            json_encode($message->getData($this))
43
        );
44
45 1
        $file = $this->config->get('file', ini_get('error_log'));
46 1
        $status = error_log($message, 3, $file);
47 1
48 1
        return compact('status', 'file');
49 1
    }
50
}
51