EmailCrons::send()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Nip\MailModule\Utility;
4
5
use Nip\MailModule\Console\Commands\EmailsCleanupData;
6
use Nip\MailModule\Console\Commands\EmailsCleanupRecords;
7
use Nip\MailModule\Console\Commands\EmailsSend;
8
9
/**
10
 * Class EmailCrons
11
 * @package Nip\MailModule\Utility
12
 */
13
class EmailCrons
14
{
15
    /**
16
     * @return int
17
     */
18
    public static function send(): int
19
    {
20
        return (new EmailsSend())->handle();
21
    }
22
23
    public static function cleanup(): void
24
    {
25
        static::cleanupData();
26
        static::cleanupRecords();
27
    }
28
29
    /**
30
     * @return mixed
31
     */
32
    public static function cleanupRecords()
33
    {
34
        return (new EmailsCleanupData())->handle();
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public static function cleanupData()
41
    {
42
        return (new EmailsCleanupRecords())->handle();
43
    }
44
}
45