Completed
Push — master ( f62f21...f72c97 )
by Freek
05:09
created

Log::send()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
3
namespace Spatie\Backup\Notifications\Senders;
4
5
use Illuminate\Contracts\Logging\Log as LogContract;
6
use Spatie\Backup\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