Completed
Push — master ( b3febe...348067 )
by Zach
04:06 queued 02:03
created

WriteError::fileWriteFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 6
rs 9.4285
1
<?php
2
3
namespace Yarak\Exceptions;
4
5
use Exception;
6
7
class WriteError extends Exception
8
{
9
    /**
10
     * Writing to the filesystem failed.
11
     *
12
     * @param string $path
13
     *
14
     * @return static
15
     */
16
    public static function fileWriteFailed($e, $path = '')
17
    {
18
        $message = "Writing to {$path} failed."."\n".$e;
19
20
        return new static($message);
21
    }
22
}
23