Parser::parse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 1
Metric Value
dl 0
loc 5
rs 9.4285
c 3
b 0
f 1
ccs 4
cts 4
cp 1
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
namespace agoalofalife\postman;
3
4
use agoalofalife\postman\Models\SheduleEmail;
5
use agoalofalife\postman\Models\Status;
6
use Carbon\Carbon;
7
8
/**
9
 * Class Parser
10
 *
11
 * @package agoalofalife\postman
12
 */
13
class Parser
14
{
15 1
    public static function parse() : void
16
    {
17 1
         SheduleEmail::whereRaw('CAST(date AS Datetime) <= ? AND status_id = ?', [Carbon::now(), Status::inProcess()])->get()
18 1
                    ->each(function ($value) {
19 1
                        $value->mode->owner->postEmail($value);
20 1
                    });
21 1
    }
22
}
23