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

CacheRedisException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 31
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setBefore() 0 3 1
A getBefore() 0 3 1
A create() 0 3 1
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