Completed
Push — master ( dfa66d...1a1ff0 )
by Yaro
01:18
created

Database::send()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php 
2
3
namespace Yaro\LogEnvelope\Drivers;
4
5
use Yaro\LogEnvelope\Models\ExceptionModel;
6
7
class Database extends AbstractDriver
8
{
9
    protected function check() 
10
    {
11
        return $this->isEnabled();
12
    }
13
    
14
    public function send()
15
    {
16
        if (!$this->check()) {
17
            return;
18
        }
19
        
20
        $data = $this->data;
21
        
22
        $data['exegutor'] = implode('<br>', array_map($data['exegutor'], function ($item) {
23
            return $item['wrap_left'] . $item['line'] . $item['wrap_right']);
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected ')', expecting ';'
Loading history...
24
        });
25
        $data['lines'] = implode("\n", $data['lines']);
26
        $data['storage'] = json_encode($data['storage']);
27
28
        $model = $this->config['model'];
29
        $model::create($data);
30
    }
31
}
32