FileNotFound   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 60
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A servicesFileNotFound() 0 7 1
A migrationFileNotFound() 0 6 1
A seederNotFound() 0 6 1
A commandNotFound() 0 6 1
1
<?php
2
3
namespace Yarak\Exceptions;
4
5
use Exception;
6
7
class FileNotFound extends Exception
8
{
9
    /**
10
     * The services file can not be resolved.
11
     *
12
     * @param string $additional
13
     *
14
     * @return static
15
     */
16
    public static function servicesFileNotFound($additional = '')
17
    {
18
        return new static(
19
            'The services file could not be found at app/config/services.php.'.
20
            $additional
21
        );
22
    }
23
24
    /**
25
     * The migration file can not be found.
26
     *
27
     * @param string $migrationFileName
28
     *
29
     * @return static
30
     */
31
    public static function migrationFileNotFound($migrationFileName, $path)
32
    {
33
        return new static(
34
            "The migration file {$migrationFileName} could not be found at {$path}."
35
        );
36
    }
37
38
    /**
39
     * The seeder file can not be found.
40
     *
41
     * @param string $seeder
42
     * @param string $path
43
     *
44
     * @return static
45
     */
46
    public static function seederNotFound($seeder, $path)
47
    {
48
        return new static(
49
            "The seeder file {$seeder} could not be found in {$path}."
50
        );
51
    }
52
53
    /**
54
     * The command file can not be found.
55
     *
56
     * @param string $command
57
     *
58
     * @return static
59
     */
60
    public static function commandNotFound($command)
61
    {
62
        return new static(
63
            "The command {$command} could not be found."
64
        );
65
    }
66
}
67