Completed
Push — master ( b9717c...8bc2a9 )
by Adrian
05:01
created
src/AttributesContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     function removeClass($className)
21 21
     {
22
-        if ( ! $this->hasClass($className)) {
22
+        if (!$this->hasClass($className)) {
23 23
             return;
24 24
         }
25 25
         $classes = preg_replace('/\b' . $className . '\b/i', '', $this->get('class'));
Please login to merge, or discard this patch.
src/DataContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
             return;
15 15
         }
16
-        if ( ! is_string($nameOrArray)) {
16
+        if (!is_string($nameOrArray)) {
17 17
             throw new \InvalidArgumentException('Only strings or arrays are accepted as first argument of the set() method of the DataContainer class');
18 18
         }
19 19
         if ($value !== null) {
Please login to merge, or discard this patch.
src/Element/Factory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 
31 31
             return $this;
32 32
         }
33
-        if ( ! is_string($classOrClosure)) {
33
+        if (!is_string($classOrClosure)) {
34 34
             throw new \RuntimeException('Input type must be a class or a closure');
35 35
         }
36
-        if ( ! class_exists($classOrClosure)) {
36
+        if (!class_exists($classOrClosure)) {
37 37
             throw new \RuntimeException(sprintf('Class %s does not exist', $classOrClosure));
38 38
         }
39
-        if ( ! is_subclass_of($classOrClosure, '\Sirius\Input\Element')) {
39
+        if (!is_subclass_of($classOrClosure, '\Sirius\Input\Element')) {
40 40
             throw new \RuntimeException(
41 41
                 sprintf('Class %s must extend the \Sirius\Input\Element class', $classOrClosure)
42 42
             );
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $element = new $class($name, $options);
71 71
         }
72 72
 
73
-        if ( ! $element instanceof Element) {
73
+        if (!$element instanceof Element) {
74 74
             throw new \RuntimeException('Cannot create a valid element based on the data provided');
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/Element/Input/File.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@
 block discarded – undo
43 43
         );
44 44
         if (is_array($this->getUploadRules())) {
45 45
             foreach ($this->getUploadRules() as $rule) {
46
-                if ( ! is_array($rule)) {
47
-                    $rule = array( $rule );
46
+                if (!is_array($rule)) {
47
+                    $rule = array($rule);
48 48
                 }
49 49
                 $name    = $rule[0];
50 50
                 $options = isset($rule[1]) ? $rule[1] : null;
Please login to merge, or discard this patch.
src/Element/Input/MultiSelect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@
 block discarded – undo
27 27
      */
28 28
     function filterValue($value, $valueIdentifier = null)
29 29
     {
30
-        if ( ! $value) {
30
+        if (!$value) {
31 31
             return null;
32 32
         }
33
-        if ( ! is_array($value)) {
33
+        if (!is_array($value)) {
34 34
             $value = (array) $value;
35 35
         }
36 36
         $allowedValues = array_keys($this->getOptions());
Please login to merge, or discard this patch.
src/Element/Input/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             $this->getName(),
72 72
             'callback',
73 73
             array(
74
-                Callback::OPTION_CALLBACK => array( $this, 'filterValue' )
74
+                Callback::OPTION_CALLBACK => array($this, 'filterValue')
75 75
             )
76 76
         );
77 77
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     function filterValue($value, $valueIdentifier = null)
88 88
     {
89
-        if ( ! $value) {
89
+        if (!$value) {
90 90
             return null;
91 91
         }
92 92
         $allowedValues = array_keys($this->getOptions());
Please login to merge, or discard this patch.
src/Traits/HasAttributesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
     protected function ensureAttributes()
11 11
     {
12
-        if ( ! isset($this[Specs::ATTRIBUTES])) {
12
+        if (!isset($this[Specs::ATTRIBUTES])) {
13 13
             $this[Specs::ATTRIBUTES] = new AttributesContainer();
14 14
         }
15 15
     }
Please login to merge, or discard this patch.
src/Traits/HasChildrenTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
             throw new \RuntimeException(sprintf('Variable $nameorElement must be a string or an instance of the Element class'));
62 62
         }
63 63
         // add the index for sorting
64
-        if ( ! isset($element['__index'])) {
65
-            $element['__index'] = ($this->elementsIndex --);
64
+        if (!isset($element['__index'])) {
65
+            $element['__index'] = ($this->elementsIndex--);
66 66
         }
67 67
         $this->elements[$name] = $element;
68 68
 
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
     protected function childComparator($childA, $childB)
136 136
     {
137 137
         if ($childA->getPosition() < $childB->getPosition()) {
138
-            return - 1;
138
+            return -1;
139 139
         }
140 140
         if ($childA->getPosition() > $childB->getPosition()) {
141 141
             return 1;
142 142
         }
143 143
         if ($childA->get('__index') > $childB->get('__index')) {
144
-            return - 1;
144
+            return -1;
145 145
         }
146 146
         if ($childA->get('__index') < $childB->get('__index')) {
147 147
             return 1;
148 148
         }
149 149
 
150 150
         // if the priority is the same, childB is first
151
-        return - 1;
151
+        return -1;
152 152
     }
153 153
 
154 154
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     function getElements()
160 160
     {
161 161
         // first sort the children so they are retrieved by priority
162
-        uasort($this->elements, array( $this, 'childComparator' ));
162
+        uasort($this->elements, array($this, 'childComparator'));
163 163
 
164 164
         return $this->elements;
165 165
     }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         foreach ($this->elements as $element) {
174 174
             $group = $element->getGroup();
175
-            if ($group && ! isset($this->elements[$group])) {
175
+            if ($group && !isset($this->elements[$group])) {
176 176
                 $element->setGroup(null);
177 177
             }
178 178
         }
Please login to merge, or discard this patch.
src/Traits/HasDataTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
     protected function ensureData()
11 11
     {
12
-        if ( ! isset($this[Specs::DATA])) {
12
+        if (!isset($this[Specs::DATA])) {
13 13
             $this[Specs::DATA] = new DataContainer();
14 14
         }
15 15
     }
Please login to merge, or discard this patch.