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

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0438

Importance

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