Completed
Pull Request — states-and-image-validation (#407)
by Ben
40:00 queued 21:37
created
src/Fields/ValidationRules/FileFieldDimensionsRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     private function addCustomValidationMessage($attribute, $params, $validator): void
41 41
     {
42 42
         $validator->setCustomMessages([
43
-            'filefield_dimensions' => 'De :attribute heeft niet de juiste afmetingen: ' . implode(', ', $params),
43
+            'filefield_dimensions' => 'De :attribute heeft niet de juiste afmetingen: '.implode(', ', $params),
44 44
         ]);
45 45
 
46 46
         if (!isset($validator->customAttributes[$attribute])) {
Please login to merge, or discard this patch.
src/Fields/ValidationRules/ImageFieldMimetypesRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $mimetype = json_decode($value)->output->type;
42 42
 
43 43
         return (in_array($mimetype, $parameters) ||
44
-            in_array(explode('/', $mimetype)[0] . '/*', $parameters));
44
+            in_array(explode('/', $mimetype)[0].'/*', $parameters));
45 45
     }
46 46
 
47 47
     /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     private function addCustomValidationMessage($attribute, $params, $validator): void
53 53
     {
54 54
         $validator->setCustomMessages([
55
-            'imagefield_mimetypes' => 'De :attribute is niet het juiste bestandstype. Volgende types zijn geldig: ' . implode(', ', $params),
55
+            'imagefield_mimetypes' => 'De :attribute is niet het juiste bestandstype. Volgende types zijn geldig: '.implode(', ', $params),
56 56
         ]);
57 57
 
58 58
         if (!isset($validator->customAttributes[$attribute])) {
Please login to merge, or discard this patch.
src/Fields/ValidationRules/FileFieldMaxRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     protected function getSize($attribute, $value)
44 44
     {
45 45
         if (!$value instanceof File) {
46
-            throw new \InvalidArgumentException('Value is expected to be of type ' . File::class);
46
+            throw new \InvalidArgumentException('Value is expected to be of type '.File::class);
47 47
         }
48 48
 
49 49
         return $value->getSize() / 1024;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     private function addCustomValidationMessage($attribute, $params, $validator): void
58 58
     {
59 59
         $validator->setCustomMessages([
60
-            'filefield_max' => 'De :attribute is te groot en dient kleiner te zijn dan ' . implode(',', $params) . 'Kb.',
60
+            'filefield_max' => 'De :attribute is te groot en dient kleiner te zijn dan '.implode(',', $params).'Kb.',
61 61
         ]);
62 62
 
63 63
         if (!isset($validator->customAttributes[$attribute])) {
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/Fields/ValidationRules/FileFieldMinRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     private function addCustomValidationMessage($attribute, $params, $validator): void
41 41
     {
42 42
         $validator->setCustomMessages([
43
-            'filefield_min' => 'De :attribute is te klein en dient groter te zijn dan ' . implode(',', $params) . 'Kb.',
43
+            'filefield_min' => 'De :attribute is te klein en dient groter te zijn dan '.implode(',', $params).'Kb.',
44 44
         ]);
45 45
 
46 46
         if (!isset($validator->customAttributes[$attribute])) {
Please login to merge, or discard this patch.
src/Fields/ValidationRules/ImageFieldMaxRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     private function addCustomValidationMessage($attribute, $params, $validator): void
63 63
     {
64 64
         $validator->setCustomMessages([
65
-            'imagefield_max' => 'De :attribute is te groot en dient kleiner te zijn dan ' . implode(',', $params) . 'Kb.',
65
+            'imagefield_max' => 'De :attribute is te groot en dient kleiner te zijn dan '.implode(',', $params).'Kb.',
66 66
         ]);
67 67
 
68 68
         if (!isset($validator->customAttributes[$attribute])) {
Please login to merge, or discard this patch.
src/Fields/ValidationRules/ImageFieldMinRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     private function addCustomValidationMessage($attribute, $params, $validator): void
60 60
     {
61 61
         $validator->setCustomMessages([
62
-            'imagefield_min' => 'De :attribute is te klein en dient groter te zijn dan ' . implode(',', $params) . 'Kb.',
62
+            'imagefield_min' => 'De :attribute is te klein en dient groter te zijn dan '.implode(',', $params).'Kb.',
63 63
         ]);
64 64
 
65 65
         if (!isset($validator->customAttributes[$attribute])) {
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.