Log   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 6 2
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