@@ -100,8 +100,9 @@ |
||
100 | 100 | */ |
101 | 101 | private static function getCacheConnection() |
102 | 102 | { |
103 | - if (config('cache.default') === 'redis') |
|
104 | - return Redis::connection('cache'); |
|
103 | + if (config('cache.default') === 'redis') { |
|
104 | + return Redis::connection('cache'); |
|
105 | + } |
|
105 | 106 | |
106 | 107 | throw new Exception("This action is only possible with redis as cache driver"); |
107 | 108 | } |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | if (!function_exists('getShortClassName')) { |
27 | 27 | function getShortClassName($class) |
28 | 28 | { |
29 | - if (!is_string($class)) |
|
30 | - $class = get_class($class); |
|
29 | + if (!is_string($class)) { |
|
30 | + $class = get_class($class); |
|
31 | + } |
|
31 | 32 | return substr(strrchr($class, '\\'), 1); |
32 | 33 | } |
33 | 34 | } |
@@ -35,8 +36,9 @@ discard block |
||
35 | 36 | if (!function_exists('getRandomArrayElement')) { |
36 | 37 | function getRandomArrayElement(array $array) |
37 | 38 | { |
38 | - if (empty($array)) |
|
39 | - return null; |
|
39 | + if (empty($array)) { |
|
40 | + return null; |
|
41 | + } |
|
40 | 42 | $randomIndex = random_int(0, sizeof($array) - 1); |
41 | 43 | return $array[$randomIndex]; |
42 | 44 | } |
@@ -44,13 +46,15 @@ discard block |
||
44 | 46 | if (!function_exists('createArrayFromFactory')) { |
45 | 47 | function createArrayFromFactory(string $modelClass, $amount = 1, ?string $state = null) |
46 | 48 | { |
47 | - if ($amount < 1) |
|
48 | - return false; |
|
49 | + if ($amount < 1) { |
|
50 | + return false; |
|
51 | + } |
|
49 | 52 | |
50 | 53 | $factory = factory($modelClass, $amount); |
51 | 54 | |
52 | - if ($state !== null) |
|
53 | - $factory->state($state); |
|
55 | + if ($state !== null) { |
|
56 | + $factory->state($state); |
|
57 | + } |
|
54 | 58 | |
55 | 59 | return $factory->raw(); |
56 | 60 | } |
@@ -61,8 +65,9 @@ discard block |
||
61 | 65 | { |
62 | 66 | $factory = factory($modelClass); |
63 | 67 | |
64 | - if ($state !== null) |
|
65 | - $factory->state($state); |
|
68 | + if ($state !== null) { |
|
69 | + $factory->state($state); |
|
70 | + } |
|
66 | 71 | |
67 | 72 | return $factory->raw(); |
68 | 73 | } |
@@ -78,8 +83,9 @@ discard block |
||
78 | 83 | if (!function_exists('classUsesTrait')) { |
79 | 84 | function classUsesTrait($class, string $trait) |
80 | 85 | { |
81 | - if (!is_string($class)) |
|
82 | - $class = get_class($class); |
|
86 | + if (!is_string($class)) { |
|
87 | + $class = get_class($class); |
|
88 | + } |
|
83 | 89 | |
84 | 90 | $traits = array_flip(class_uses_recursive($class)); |
85 | 91 |