@@ -73,8 +73,9 @@ |
||
73 | 73 | { |
74 | 74 | $type = $this->getType(); |
75 | 75 | |
76 | - if (in_array($type, $this->types)) |
|
77 | - return "test-" . $type . ".stub"; |
|
76 | + if (in_array($type, $this->types)) { |
|
77 | + return "test-" . $type . ".stub"; |
|
78 | + } |
|
78 | 79 | |
79 | 80 | throw new Exception("Test type not supported"); |
80 | 81 | } |
@@ -31,13 +31,14 @@ |
||
31 | 31 | $guards = []; |
32 | 32 | if (!is_array($this->guard)) { |
33 | 33 | $guards[] = $this->guard; |
34 | + } else { |
|
35 | + $guards = $this->guard; |
|
34 | 36 | } |
35 | - else |
|
36 | - $guards = $this->guard; |
|
37 | 37 | |
38 | 38 | foreach ($guards as $guard) { |
39 | - if (!($guard instanceof GuardContract)) |
|
40 | - throw new UnexpectedTypeException($guard, GuardContract::class); |
|
39 | + if (!($guard instanceof GuardContract)) { |
|
40 | + throw new UnexpectedTypeException($guard, GuardContract::class); |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | return $guards; |
43 | 44 | } |
@@ -45,10 +45,11 @@ |
||
45 | 45 | { |
46 | 46 | foreach ($this->guards as $guard) { |
47 | 47 | if ($guard->condition()) { |
48 | - if (isset($this->exception)) |
|
49 | - throw $this->exception; |
|
50 | - else |
|
51 | - throw $guard->exception(); |
|
48 | + if (isset($this->exception)) { |
|
49 | + throw $this->exception; |
|
50 | + } else { |
|
51 | + throw $guard->exception(); |
|
52 | + } |
|
52 | 53 | } |
53 | 54 | } |
54 | 55 | } |