Log::send()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EricMakesStuff\ServerMonitor\Notifications\Senders;
4
5
use Illuminate\Contracts\Logging\Log as LogContract;
6
use EricMakesStuff\ServerMonitor\Notifications\BaseSender;
7
8
class Log extends BaseSender
9
{
10
    /** @var \Illuminate\Contracts\Logging\Log */
11
    protected $log;
12
13
    /**
14
     * @param \Illuminate\Contracts\Logging\Log $log
15
     */
16
    public function __construct(LogContract $log)
17
    {
18
        $this->log = $log;
19
    }
20
21
    public function send()
22
    {
23
        $method = ($this->type === static::TYPE_SUCCESS ? 'info' : 'error');
24
25
        $this->log->$method("{$this->subject}: {$this->message}");
26
    }
27
}
28