Passed
Pull Request — main (#9)
by
unknown
07:12 queued 03:32
created

ViewException   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 35
ccs 6
cts 7
cp 0.8571
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A tagSyntaxError() 0 3 1
A invalidDecorator() 0 3 1
A invalidComponentClass() 0 3 1
A missingComponentParameters() 0 3 1
A noComponentClass() 0 3 1
A invalidComponentMethod() 0 3 1
A invalidComponentParameter() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Blitz PHP framework.
5
 *
6
 * (c) 2022 Dimitri Sitchet Tomkeu <[email protected]>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace BlitzPHP\Exceptions;
13
14
class ViewException extends FrameworkException
15
{
16
    public static function invalidComponentMethod(string $class, string $method)
17
    {
18 2
        return new static(lang('View.invalidComponentMethod', ['class' => $class, 'method' => $method]));
19
    }
20
21
    public static function missingComponentParameters(string $class, string $method)
22
    {
23 2
        return new static(lang('View.missingComponentParameters', ['class' => $class, 'method' => $method]));
24
    }
25
26
    public static function invalidComponentParameter(string $key)
27
    {
28 2
        return new static(lang('View.invalidComponentParameter', [$key]));
29
    }
30
31
    public static function noComponentClass()
32
    {
33 2
        return new static(lang('View.noComponentClass'));
34
    }
35
36
    public static function invalidComponentClass(?string $class = null)
37
    {
38 2
        return new static(lang('View.invalidComponentClass', [$class]));
39
    }
40
41
    public static function tagSyntaxError(string $output)
42
    {
43
        return new static(lang('View.tagSyntaxError', [$output]));
44
    }
45
46
    public static function invalidDecorator(string $className)
47
    {
48 2
        return new static(lang('View.invalidDecoratorClass', [$className]));
49
    }
50
}
51