Completed
Push — master ( 5ac3d3...00813e )
by Askupa
02:22
created
components/number/controller.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 class Component_number
9 9
 extends AbstractComponent
10 10
 implements ValueComponentInterface, 
11
-           DisableableComponentInterface,
12
-           FilterableComponentInterface,
13
-           ValidatableComponentInterface
11
+            DisableableComponentInterface,
12
+            FilterableComponentInterface,
13
+            ValidatableComponentInterface
14 14
 {
15 15
     public $component_type = 'number';
16 16
     
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
             'required'      => false,
28 28
             'readonly'      => false,
29 29
             'default'       => null,
30
-            'filter'        => array( $this, 'filter' ),
31
-            'validation'    => array( $this, 'validation' )
30
+            'filter'        => array($this, 'filter'),
31
+            'validation'    => array($this, 'validation')
32 32
         );
33 33
     }
34 34
     
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
         return floatval($v);
38 38
     }
39 39
     
40
-    public function validation($v,&$e)
40
+    public function validation($v, &$e)
41 41
     {
42 42
         $max = $this->max;
43 43
         $min = $this->min;
44 44
         
45
-        if(null !== $max && $v > $max)
45
+        if (null !== $max && $v > $max)
46 46
         {
47
-            $e = sprintf( __("Value must be less than %d",'amarkal'), $max);
47
+            $e = sprintf(__("Value must be less than %d", 'amarkal'), $max);
48 48
         }
49 49
 
50
-        if(null !== $min && $v < $min) 
50
+        if (null !== $min && $v < $min) 
51 51
         {
52
-            $e = sprintf( __("Value must be greater than %d",'amarkal'), $min);
52
+            $e = sprintf(__("Value must be greater than %d", 'amarkal'), $min);
53 53
         }
54 54
 
55 55
         return $e ? false : true;
Please login to merge, or discard this patch.
components/text/controller.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 class Component_text
9 9
 extends AbstractComponent
10 10
 implements ValueComponentInterface, 
11
-           DisableableComponentInterface,
12
-           FilterableComponentInterface,
13
-           ValidatableComponentInterface
11
+            DisableableComponentInterface,
12
+            FilterableComponentInterface,
13
+            ValidatableComponentInterface
14 14
 {
15 15
     public $component_type = 'text';
16 16
     
Please login to merge, or discard this patch.
components/radio/controller.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 class Component_radio
9 9
 extends AbstractComponent
10 10
 implements ValueComponentInterface, 
11
-           DisableableComponentInterface
11
+            DisableableComponentInterface
12 12
 {
13 13
     public $component_type = 'radio';
14 14
     
Please login to merge, or discard this patch.
AbstractComponent.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * 
34 34
      * @param array $model
35 35
      */
36
-    public function __construct( array $model = array() ) 
36
+    public function __construct(array $model = array()) 
37 37
     {
38 38
         parent::__construct($model);
39 39
         
@@ -74,24 +74,24 @@  discard block
 block discarded – undo
74 74
      * 
75 75
      * @return array
76 76
      */
77
-    public function set_model( $model )
77
+    public function set_model($model)
78 78
     {
79 79
         // Check that the required arguments are provided.
80
-        foreach( $this->required_arguments() as $key )
80
+        foreach ($this->required_arguments() as $key)
81 81
         {
82
-            if ( !isset($model[$key]) )
82
+            if (!isset($model[$key]))
83 83
             {
84 84
                 throw new \RuntimeException('The required argument "'.$key.'" was not provided for '.get_called_class());
85 85
             }
86 86
         }
87 87
         
88 88
         // Assign the name of the component as the id if no id was specified
89
-        if( !isset($model['id']) )
89
+        if (!isset($model['id']))
90 90
         {
91 91
             $model['id'] = $model['name'];
92 92
         }
93 93
         
94
-        $this->model = array_merge( $this->default_model(), $model );
94
+        $this->model = array_merge($this->default_model(), $model);
95 95
     }
96 96
     
97 97
     /**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      * 
111 111
      * @param string $class
112 112
      */
113
-    public function add_html_class( $class )
113
+    public function add_html_class($class)
114 114
     {
115
-        if( !in_array($class, $this->html_classes) )
115
+        if (!in_array($class, $this->html_classes))
116 116
         {
117 117
             $this->html_classes[] = $class;
118 118
         }
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
      * 
125 125
      * @param string $class
126 126
      */
127
-    public function remove_html_class( $class )
127
+    public function remove_html_class($class)
128 128
     {
129 129
         $i = 0;
130
-        foreach( $this->html_classes as $c )
130
+        foreach ($this->html_classes as $c)
131 131
         {
132
-            if( $c === $class )
132
+            if ($c === $class)
133 133
             {
134
-                array_splice($this->html_classes,$i,1);
134
+                array_splice($this->html_classes, $i, 1);
135 135
                 break;
136 136
             }
137 137
             $i++;
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
      * 
144 144
      * @param type $validity
145 145
      */
146
-    Public function set_validity( $validity )
146
+    Public function set_validity($validity)
147 147
     {
148 148
         $this->validity = $validity;
149
-        if($validity === $this::INVALID)
149
+        if ($validity === $this::INVALID)
150 150
         {
151 151
             $this->add_html_class('amarkal-ui-component-error');
152 152
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * 
170 170
      * {@inheritdoc}
171 171
      */
172
-    public function render( $echo = false )
172
+    public function render($echo = false)
173 173
     {
174 174
         $this->enqueue_scripts();
175 175
         return parent::render($echo);
Please login to merge, or discard this patch.