Test Failed
Pull Request — main (#9)
by
unknown
12:20
created

TasksException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidTaskType() 0 3 1
A invalidCronExpression() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of BlitzPHP Tasks.
7
 *
8
 * (c) 2025 Dimitri Sitchet Tomkeu <[email protected]>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13
14
namespace BlitzPHP\Tasks\Exceptions;
15
16
use RuntimeException;
17
18
/**
19
 * @credit <a href="https://tasks.codeigniter.com">CodeIgniter4 - CodeIgniter\Tasks\Exceptions\TasksException</a>
20
 */
21
final class TasksException extends RuntimeException
22
{
23
    public static function invalidTaskType(string $type): self
24
    {
25
        return new self(lang('Tasks.invalidTaskType', [$type]));
26
    }
27
28
    public static function invalidCronExpression(string $string): self
29
    {
30 2
        return new self(lang('Tasks.invalidCronExpression', [$string]));
31
    }
32
}
33