@@ -7,41 +7,41 @@ |
||
7 | 7 | |
8 | 8 | class VariablesTest extends TestCase |
9 | 9 | { |
10 | - /** |
|
11 | - * Setup the test environment. |
|
12 | - */ |
|
13 | - protected function setUp(): void |
|
14 | - { |
|
15 | - parent::setUp(); |
|
10 | + /** |
|
11 | + * Setup the test environment. |
|
12 | + */ |
|
13 | + protected function setUp(): void |
|
14 | + { |
|
15 | + parent::setUp(); |
|
16 | 16 | |
17 | - Variable::migrate(); |
|
18 | - } |
|
17 | + Variable::migrate(); |
|
18 | + } |
|
19 | 19 | |
20 | - public function testVariableStorage() |
|
21 | - { |
|
22 | - $varString = 'test'; |
|
20 | + public function testVariableStorage() |
|
21 | + { |
|
22 | + $varString = 'test'; |
|
23 | 23 | |
24 | - Variable::memorize('testString', $varString); |
|
24 | + Variable::memorize('testString', $varString); |
|
25 | 25 | |
26 | - $this->assertEquals($varString, Variable::recall('testString'), 'String variable not stored correctly in database'); |
|
26 | + $this->assertEquals($varString, Variable::recall('testString'), 'String variable not stored correctly in database'); |
|
27 | 27 | |
28 | - Variable::forget('testString'); |
|
28 | + Variable::forget('testString'); |
|
29 | 29 | |
30 | - $this->assertEmpty(Variable::recall('testString'), 'String variable not cleared correctly from database'); |
|
30 | + $this->assertEmpty(Variable::recall('testString'), 'String variable not cleared correctly from database'); |
|
31 | 31 | |
32 | - $varArray = [ |
|
33 | - 'aa' => 'test1', |
|
34 | - 'bb' => 'test2' |
|
35 | - ]; |
|
32 | + $varArray = [ |
|
33 | + 'aa' => 'test1', |
|
34 | + 'bb' => 'test2' |
|
35 | + ]; |
|
36 | 36 | |
37 | - Variable::memorize('testArray', $varArray); |
|
37 | + Variable::memorize('testArray', $varArray); |
|
38 | 38 | |
39 | - $this->assertEquals($varArray, Variable::recall('testArray'), 'Array variable not stored correctly in database'); |
|
39 | + $this->assertEquals($varArray, Variable::recall('testArray'), 'Array variable not stored correctly in database'); |
|
40 | 40 | |
41 | - Variable::forget('testArray'); |
|
41 | + Variable::forget('testArray'); |
|
42 | 42 | |
43 | - $this->assertEmpty(Variable::recall('testArray'), 'String variable not cleared correctly from database'); |
|
44 | - } |
|
43 | + $this->assertEmpty(Variable::recall('testArray'), 'String variable not cleared correctly from database'); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | |
47 | 47 | } |
48 | 48 | \ No newline at end of file |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | class User extends Model |
9 | 9 | { |
10 | - use HasEpesiConnection; |
|
10 | + use HasEpesiConnection; |
|
11 | 11 | |
12 | 12 | public $table = 'users'; |
13 | 13 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * Label of the module |
65 | 65 | */ |
66 | 66 | public static function label() { |
67 | - return static::$label?: ucwords(str_ireplace('.', ' ', static::alias())); |
|
67 | + return static::$label ?: ucwords(str_ireplace('.', ' ', static::alias())); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | { |
77 | 77 | $templatesDir = static::path() . DIRECTORY_SEPARATOR . 'Templates'; |
78 | 78 | |
79 | - if (! is_dir($templatesDir)) return; |
|
79 | + if (!is_dir($templatesDir)) return; |
|
80 | 80 | |
81 | 81 | $skinDir = $templatesDir . DIRECTORY_SEPARATOR . $skin; |
82 | 82 | |
83 | - return is_dir($skinDir)? $skinDir: $templatesDir; |
|
83 | + return is_dir($skinDir) ? $skinDir : $templatesDir; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public static function translations() |
@@ -46,7 +46,9 @@ |
||
46 | 46 | { |
47 | 47 | $templatesDir = static::path() . DIRECTORY_SEPARATOR . 'Templates'; |
48 | 48 | |
49 | - if (! is_dir($templatesDir)) return; |
|
49 | + if (! is_dir($templatesDir)) { |
|
50 | + return; |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $skinDir = $templatesDir . DIRECTORY_SEPARATOR . $skin; |
52 | 54 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | $joint = new $class(); |
26 | 26 | |
27 | - if (! $joint->access()) continue; |
|
27 | + if (!$joint->access()) continue; |
|
28 | 28 | |
29 | 29 | $ret->add($joint); |
30 | 30 | } |
@@ -29,7 +29,9 @@ |
||
29 | 29 | */ |
30 | 30 | $joint = new $class(); |
31 | 31 | |
32 | - if (! $joint->access()) continue; |
|
32 | + if (! $joint->access()) { |
|
33 | + continue; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | $ret->add($joint); |
35 | 37 | } |
@@ -16,7 +16,9 @@ |
||
16 | 16 | { |
17 | 17 | $class = self::namespace() . '\\' . ($alias? Str::studly($alias): (static::name() . 'View')); |
18 | 18 | |
19 | - if ($alias) return $class; |
|
19 | + if ($alias) { |
|
20 | + return $class; |
|
21 | + } |
|
20 | 22 | |
21 | 23 | return static::$view?: $class; |
22 | 24 | } |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | */ |
15 | 15 | final public static function view($alias = null) |
16 | 16 | { |
17 | - $class = self::namespace() . '\\' . ($alias? Str::studly($alias): (static::name() . 'View')); |
|
17 | + $class = self::namespace() . '\\' . ($alias ? Str::studly($alias) : (static::name() . 'View')); |
|
18 | 18 | |
19 | 19 | if ($alias) return $class; |
20 | 20 | |
21 | - return static::$view?: $class; |
|
21 | + return static::$view ?: $class; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | throw new \Exception('Undefined alias in module core class ' . static::class); |
33 | 33 | } |
34 | 34 | |
35 | - return static::$alias?? static::module()::alias(); |
|
35 | + return static::$alias ?? static::module()::alias(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $names = array_slice(explode('\\', static::class), -2, -1); |
67 | 67 | |
68 | - return $names? reset($names): ''; |
|
68 | + return $names ? reset($names) : ''; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $link = $this->link(); |
35 | 35 | |
36 | - $link = is_array($link)? ModuleView::moduleLink(...$link): $link; |
|
36 | + $link = is_array($link) ? ModuleView::moduleLink(...$link) : $link; |
|
37 | 37 | |
38 | 38 | return (new LaunchButton([ |
39 | 39 | 'label' => $this->label(), |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | final public static function packageManifest() |
13 | 13 | { |
14 | - return self::$packageManifest = self::$packageManifest?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath()); |
|
14 | + return self::$packageManifest = self::$packageManifest ?: new PackageManifest(new Filesystem(), app()->basePath(), self::getCachedManifestPath()); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | final public static function getCachedManifestPath() |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | $paths = $this->migrations(); |
22 | 22 | |
23 | - foreach (is_array($paths)? $paths: [$paths] as $path) { |
|
23 | + foreach (is_array($paths) ? $paths : [$paths] as $path) { |
|
24 | 24 | \Illuminate\Support\Facades\Artisan::call('migrate', ['--path' => $path, '--force' => true]); |
25 | 25 | } |
26 | 26 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $paths = $this->migrations(); |
33 | 33 | |
34 | - foreach (is_array($paths)? $paths: [$paths] as $path) { |
|
34 | + foreach (is_array($paths) ? $paths : [$paths] as $path) { |
|
35 | 35 | \Illuminate\Support\Facades\Artisan::call('migrate:rollback', ['--path' => $path]); |
36 | 36 | } |
37 | 37 |
@@ -48,8 +48,8 @@ |
||
48 | 48 | $alias = class_exists($module)? $module::alias(): $module; |
49 | 49 | |
50 | 50 | if (is_array($method) && !$args) { |
51 | - $args = $method; |
|
52 | - $method = 'body'; |
|
51 | + $args = $method; |
|
52 | + $method = 'body'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return url(implode('/', ['view', $alias, $method, self::encodeArgs($args)])); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | $defaultView = self::module()::view(); |
23 | 23 | |
24 | - $viewClass = is_a(static::class, ModuleView::class, true)? static::class: $defaultView; |
|
24 | + $viewClass = is_a(static::class, ModuleView::class, true) ? static::class : $defaultView; |
|
25 | 25 | |
26 | 26 | $viewAlias = null; |
27 | 27 | if ($viewClass !== $defaultView) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | final public static function moduleLink($module, $method = 'body', $args = []) |
47 | 47 | { |
48 | - $alias = class_exists($module)? $module::alias(): $module; |
|
48 | + $alias = class_exists($module) ? $module::alias() : $module; |
|
49 | 49 | |
50 | 50 | if (is_array($method) && !$args) { |
51 | 51 | $args = $method; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @throws \Illuminate\Http\Exceptions\HttpResponseException |
65 | 65 | */ |
66 | 66 | final public static function decodeArgs($hash) { |
67 | - if (! $hash) return []; |
|
67 | + if (!$hash) return []; |
|
68 | 68 | |
69 | 69 | $args = session($hash); |
70 | 70 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | final public static function encodeArgs($args) { |
83 | 83 | $args = (array) $args; |
84 | 84 | |
85 | - if (! $args) return; |
|
85 | + if (!$args) return; |
|
86 | 86 | |
87 | 87 | $hash = md5(serialize($args)); |
88 | 88 |
@@ -64,11 +64,15 @@ discard block |
||
64 | 64 | * @throws \Illuminate\Http\Exceptions\HttpResponseException |
65 | 65 | */ |
66 | 66 | final public static function decodeArgs($hash) { |
67 | - if (! $hash) return []; |
|
67 | + if (! $hash) { |
|
68 | + return []; |
|
69 | + } |
|
68 | 70 | |
69 | 71 | $args = session($hash); |
70 | 72 | |
71 | - if (is_null($args)) abort(419); |
|
73 | + if (is_null($args)) { |
|
74 | + abort(419); |
|
75 | + } |
|
72 | 76 | |
73 | 77 | return (array) $args; |
74 | 78 | } |
@@ -82,7 +86,9 @@ discard block |
||
82 | 86 | final public static function encodeArgs($args) { |
83 | 87 | $args = (array) $args; |
84 | 88 | |
85 | - if (! $args) return; |
|
89 | + if (! $args) { |
|
90 | + return; |
|
91 | + } |
|
86 | 92 | |
87 | 93 | $hash = md5(serialize($args)); |
88 | 94 |