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.
Passed
Push — master ( 0dfbe8...5a63b8 )
by Carlos
02:47
created

ErrorlogGateway   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 86.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 30
ccs 13
cts 15
cp 0.8667
rs 10
c 0
b 0
f 0

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