EmailCrons   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 4
eloc 6
c 3
b 0
f 2
dl 0
loc 30
ccs 0
cts 10
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A cleanup() 0 4 1
A cleanupRecords() 0 3 1
A send() 0 3 1
A cleanupData() 0 3 1
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