Completed
Push — master ( c38bce...f841dc )
by Roberts
05:53 queued 01:18
created
src/Admin/Settings/Settings.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
      * @param mixed $default
30 30
      * @return mixed
31 31
      */
32
-    public function get( string $key, $default = null )
32
+    public function get(string $key, $default = null)
33 33
     {
34
-        $definition = $this->settingRegistry->find( $key );
34
+        $definition = $this->settingRegistry->find($key);
35 35
 
36
-        if( !$definition )
36
+        if (!$definition)
37 37
         {
38 38
             return $default;
39 39
         }
40 40
 
41
-        if( $definition->isFile() )
41
+        if ($definition->isFile())
42 42
         {
43 43
             return $definition->getModel()->file ?? $default;
44 44
         }
45 45
 
46
-        if( $definition->isTranslatable() )
46
+        if ($definition->isTranslatable())
47 47
         {
48
-            return $definition->getModel()->getAttribute( 'value' ) ?? $default;
48
+            return $definition->getModel()->getAttribute('value') ?? $default;
49 49
         }
50 50
 
51 51
         return $definition->getValue() ?: $default;
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
      * @param string $key
56 56
      * @return bool
57 57
      */
58
-    public function has( string $key )
58
+    public function has(string $key)
59 59
     {
60
-        return (bool) $this->get( $key );
60
+        return (bool) $this->get($key);
61 61
     }
62 62
 
63 63
     /**
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
      * @param mixed $type
67 67
      * @return void
68 68
      */
69
-    public function set( string $key, $value, string $type = null )
69
+    public function set(string $key, $value, string $type = null)
70 70
     {
71
-        $definition = new SettingDefinition( $key, $value, $type );
71
+        $definition = new SettingDefinition($key, $value, $type);
72 72
 
73
-        $this->settingRegistry->register( $definition );
73
+        $this->settingRegistry->register($definition);
74 74
 
75 75
         $definition->save();
76 76
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function all(): Collection
82 82
     {
83
-        return $this->settingRegistry->getSettings()->mapWithKeys( function( SettingDefinition $definition )
83
+        return $this->settingRegistry->getSettings()->mapWithKeys(function(SettingDefinition $definition)
84 84
         {
85 85
             return [ $definition->getKey() => $definition->getValue() ];
86 86
         } );
Please login to merge, or discard this patch.