Passed
Push — main ( 72c6fa...9344f0 )
by Sílvio
02:59
created

CacheFileException::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Silviooosilva\CacheerPhp\Exceptions;
4
5
use Exception;
6
7
class CacheFileException extends BaseException
8
{
9
10
  /** @param string $before */
11
  private static string $before = "<File Cache Store Exception>";
12
13
  /**
14
  * @return void
15
  */
16
  public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = [])
17
  {
18
    return new self(self::getBefore() . ": " .$message, $code, $previous, $details);
0 ignored issues
show
Bug Best Practice introduced by
The expression return new self(self::ge...e, $previous, $details) returns the type Silviooosilva\CacheerPhp...ions\CacheFileException which is incompatible with the documented return type void.
Loading history...
19
  }
20
21
22
  /**
23
  * @return string
24
  */
25
  public static function getBefore()
26
  {
27
    return self::$before;
28
  }
29
30
  /**
31
  * @return void
32
  */
33
  public static function setBefore(string $text)
34
  {
35
    self::$before = $text;
36
  }
37
38
}
39
40