Test Failed
Push — ft/elements ( 383c8a )
by Ben
10:58
created
src/Fields/Types/FieldType.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,21 +4,21 @@
 block discarded – undo
4 4
 
5 5
 class FieldType
6 6
 {
7
-    const INPUT = 'input';   // oneliner text (input)
8
-    const TEXT = 'text';    // Plain text (textarea)
7
+    const INPUT = 'input'; // oneliner text (input)
8
+    const TEXT = 'text'; // Plain text (textarea)
9 9
     const NUMBER = 'number'; // number
10 10
     const RANGE = 'range'; // range slider
11
-    const DATE = 'date';    // Timestamp input
12
-    const PHONENUMBER = 'phonenumber';    // Timestamp input
13
-    const HTML = 'html';    // Html text (wysiwyg)
14
-    const SELECT = 'select';  // Select options
11
+    const DATE = 'date'; // Timestamp input
12
+    const PHONENUMBER = 'phonenumber'; // Timestamp input
13
+    const HTML = 'html'; // Html text (wysiwyg)
14
+    const SELECT = 'select'; // Select options
15 15
     //const MEDIA = 'media';  // media file
16
-    const FILE = 'file';  // regular file
17
-    const IMAGE = 'image';  // image (slim uploader)
18
-    const DOCUMENT = 'document';  // documents
19
-    const RADIO = 'radio';  // radio select
20
-    const CHECKBOX = 'checkbox';  // checkbox select
21
-    const PAGEBUILDER = 'pagebuilder';  // the most special field there is...
16
+    const FILE = 'file'; // regular file
17
+    const IMAGE = 'image'; // image (slim uploader)
18
+    const DOCUMENT = 'document'; // documents
19
+    const RADIO = 'radio'; // radio select
20
+    const CHECKBOX = 'checkbox'; // checkbox select
21
+    const PAGEBUILDER = 'pagebuilder'; // the most special field there is...
22 22
 
23 23
     /** @var string */
24 24
     private $type;
Please login to merge, or discard this patch.
src/Fields/Validation/ValidationParameters.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             }
50 50
 
51 51
             if (isset($customRules[$rule])) {
52
-                $rules[$k] = $customRules[$rule] . ($params ? ':' . $params : '');
52
+                $rules[$k] = $customRules[$rule].($params ? ':'.$params : '');
53 53
             }
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Fields/Validation/ValidationNames.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 }
95 95
 
96 96
                 foreach ($replacements as $replacement) {
97
-                    $newKeySet[] = str_replace(':' . $placeholder, $replacement, $key);
97
+                    $newKeySet[] = str_replace(':'.$placeholder, $replacement, $key);
98 98
                 }
99 99
             }
100 100
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
             // Remove all 'trans' entries for this locale
144 144
             foreach ($filteredKeys as $i => $key) {
145
-                if (Str::startsWith($key, 'trans.' . $locale)) {
145
+                if (Str::startsWith($key, 'trans.'.$locale)) {
146 146
                     unset($filteredKeys[$i]);
147 147
                 }
148 148
             }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $payload = Arr::get($this->payload, $key, '_notfound_');
164 164
 
165 165
             // If the payload is empty and this is not the entry for the required locale
166
-            if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.' . $this->requiredLocale)) {
166
+            if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.'.$this->requiredLocale)) {
167 167
                 unset($filteredKeys[$i]);
168 168
             }
169 169
         }
Please login to merge, or discard this patch.
src/Fields/FieldName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
             return $value;
80 80
         }
81 81
 
82
-        $value = str_replace('.', '][', $value) . ']';
82
+        $value = str_replace('.', '][', $value).']';
83 83
 
84 84
         return substr_replace($value, '', strpos($value, ']'), 1);
85 85
     }
Please login to merge, or discard this patch.
src/Fields/SavingFields.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@
 block discarded – undo
66 66
             foreach ($this->assistants() as $assistant) {
67 67
                 if (method_exists($assistant, $saveMethod)) {
68 68
                     $this->saveAssistantMethods[$field->getKey()] = ['field'     => $field,
69
-                                                                     'method'    => $saveMethod,
70
-                                                                     'assistant' => $assistant,
69
+                                                                        'method'    => $saveMethod,
70
+                                                                        'assistant' => $assistant,
71 71
                     ];
72 72
 
73 73
                     return true;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             }
32 32
 
33 33
             // Custom set methods - default is the generic setField() method.
34
-            $methodName = 'set' . ucfirst(Str::camel($field->getKey())) . 'Field';
34
+            $methodName = 'set'.ucfirst(Str::camel($field->getKey())).'Field';
35 35
             (method_exists($this, $methodName))
36 36
                 ? $this->$methodName($field, $request)
37 37
                 : $this->setField($field, $request);
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
     protected function detectCustomSaveMethods(Field $field): bool
50 50
     {
51
-        $saveMethodByKey = 'save' . ucfirst(Str::camel($field->getKey())) . 'Field';
52
-        $saveMethodByType = 'save' . ucfirst(Str::camel($field->getType()->get())) . 'Fields';
51
+        $saveMethodByKey = 'save'.ucfirst(Str::camel($field->getKey())).'Field';
52
+        $saveMethodByType = 'save'.ucfirst(Str::camel($field->getType()->get())).'Fields';
53 53
 
54 54
         foreach ([$saveMethodByKey, $saveMethodByType] as $saveMethod) {
55 55
             foreach ($this->assistants() as $assistant) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
             // Make our media fields able to be translatable as well...
98 98
             if ($field->ofType(FieldType::FILE, FieldType::IMAGE)) {
99
-                throw new \Exception('Cannot process the ' . $field->getKey() . ' media field. Currently no support for translatable media files. We should fix this!');
99
+                throw new \Exception('Cannot process the '.$field->getKey().' media field. Currently no support for translatable media files. We should fix this!');
100 100
             }
101 101
 
102 102
             // Okay so this is a bit odd but since all translations are expected to be inside the trans
Please login to merge, or discard this patch.
src/Fields/Fields.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 continue;
67 67
             }
68 68
 
69
-            $method = 'get' . ucfirst($key);
69
+            $method = 'get'.ucfirst($key);
70 70
 
71 71
             // Reject from list if value does not match expected one
72 72
             if ($value && $value == $field->$method()) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     public function offsetSet($offset, $value)
125 125
     {
126 126
         if (!$value instanceof Field) {
127
-            throw new \InvalidArgumentException('Passed value must be of type ' . Field::class);
127
+            throw new \InvalidArgumentException('Passed value must be of type '.Field::class);
128 128
         }
129 129
 
130 130
         $this->fields[$offset] = $value;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
     private function validateFields(array $fields)
156 156
     {
157
-        array_map(function (Field $field) {
157
+        array_map(function(Field $field) {
158 158
         }, $fields);
159 159
     }
160 160
 
Please login to merge, or discard this patch.
src/Fields/ValidationRules/ValidatesExistingAssetAttributes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     protected function validateAssetMimetypes(Asset $asset, $parameters)
57 57
     {
58 58
         return (in_array($asset->getMimeType(), $parameters) ||
59
-            in_array(explode('/', $asset->getMimeType())[0] . '/*', $parameters));
59
+            in_array(explode('/', $asset->getMimeType())[0].'/*', $parameters));
60 60
     }
61 61
 
62 62
     protected function validateAssetMax(Asset $asset, $parameters)
Please login to merge, or discard this patch.
src/FlatReferences/FlatReference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
     public function get(): string
41 41
     {
42
-        return $this->className . '@' . $this->id;
42
+        return $this->className.'@'.$this->id;
43 43
     }
44 44
 
45 45
     public function equals($other): bool
Please login to merge, or discard this patch.
src/FlatReferences/FlatReferenceFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
     public static function fromString(string $reference): FlatReference
8 8
     {
9 9
         if (false == strpos($reference, '@')) {
10
-            throw new \InvalidArgumentException('Invalid reference composition. A flat reference should honour schema <class>@<id>. [' . $reference . '] was passed instead.');
10
+            throw new \InvalidArgumentException('Invalid reference composition. A flat reference should honour schema <class>@<id>. ['.$reference.'] was passed instead.');
11 11
         }
12 12
 
13 13
         list($className, $id) = explode('@', $reference);
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         $instance->{$instance->getKeyName()} = $id;
17 17
 
18 18
         if (!method_exists($instance, 'flatReference')) {
19
-            throw new \InvalidArgumentException('Instance created from model reference [' . $reference . '] was expected to have a method of flatReference() but is has not.');
19
+            throw new \InvalidArgumentException('Instance created from model reference ['.$reference.'] was expected to have a method of flatReference() but is has not.');
20 20
         }
21 21
 
22 22
         return $instance->flatReference();
Please login to merge, or discard this patch.