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

CacheRedisException::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 CacheRedisException extends BaseException
8
{
9
10
11
  /** @param string $before */
12
  private static string $before = "<Redis Cache Store Exception>";
13
14
15
    /**
16
  * @return void
17
  */
18
  public static function create(string $message = "", int $code = 0, ?Exception $previous = null, array $details = [])
19
  {
20
    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...ons\CacheRedisException which is incompatible with the documented return type void.
Loading history...
21
  }
22
23
24
  /**
25
  * @return string
26
  */
27
  public static function getBefore()
28
  {
29
    return self::$before;
30
  }
31
32
  /**
33
  * @return void
34
  */
35
  public static function setBefore(string $text)
36
  {
37
    self::$before = $text;
38
  }
39
40
}
41
42