DumpFailed::processDidNotEndSuccessfully()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\DbDumper\Exceptions;
4
5
use Exception;
6
use Symfony\Component\Process\Process;
7
8
class DumpFailed extends Exception
9
{
10
    /**
11
     * @param \Symfony\Component\Process\Process $process
12
     *
13
     * @return \Spatie\DbDumper\Exceptions\DumpFailed
14
     */
15
    public static function processDidNotEndSuccessfully(Process $process)
16
    {
17
        return new static("The dump process failed with exitcode {$process->getExitCode()} : {$process->getExitCodeText()} : {$process->getErrorOutput()}");
18
    }
19
20
    /**
21
     * @return \Spatie\DbDumper\Exceptions\DumpFailed
22
     */
23
    public static function dumpfileWasNotCreated()
24
    {
25
        return new static('The dumpfile could not be created');
26
    }
27
28
    /**
29
     * @return \Spatie\DbDumper\Exceptions\DumpFailed
30
     */
31
    public static function dumpfileWasEmpty()
32
    {
33
        return new static('The created dumpfile is empty');
34
    }
35
}
36