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::send()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 2.0094

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 13
cts 15
cp 0.8667
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 13
nc 2
nop 3
crap 2.0094
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