@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | protected function initHasAcceptsMediaWithValidation() |
26 | 26 | { |
27 | - $this->acceptsMedia(function ($file) { |
|
27 | + $this->acceptsMedia(function($file) { |
|
28 | 28 | /** @var AbstractValidator $validator */ |
29 | 29 | $validator = $this->getValidator(); |
30 | 30 | $constraint = $this->getConstraint(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | protected function initHasAcceptsMediaEmpty() |
41 | 41 | { |
42 | - $this->acceptsMedia(function () { |
|
42 | + $this->acceptsMedia(function() { |
|
43 | 43 | return true; |
44 | 44 | }); |
45 | 45 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | { |
49 | 49 | $media = $this->getMedia(); |
50 | 50 | $destination = PathGeneratorFactory::create()::getBasePathForMediaOriginal($media); |
51 | - $destination .= DIRECTORY_SEPARATOR.$media->getCollection()->getStrategy()::makeFileName($this); |
|
51 | + $destination .= DIRECTORY_SEPARATOR . $media->getCollection()->getStrategy()::makeFileName($this); |
|
52 | 52 | |
53 | 53 | $media->generateFileFromContent($destination, fopen($this->getPathToFile(), 'r')); |
54 | 54 |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $firstName = $this->getClassFirstName(); |
97 | 97 | $contraintFirstName = str_replace('Validator', 'Constraint', $firstName); |
98 | 98 | |
99 | - return str_replace('\Validators\\'.$firstName, '\Constraints\\'.$contraintFirstName, $className); |
|
99 | + return str_replace('\Validators\\' . $firstName, '\Constraints\\' . $contraintFirstName, $className); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $constraint = $this->getConstraint(); |
56 | 56 | |
57 | 57 | if ($constraint->mimeTypes) { |
58 | - $mimeTypes = (array) $constraint->mimeTypes; |
|
58 | + $mimeTypes = (array)$constraint->mimeTypes; |
|
59 | 59 | $mime = $this->determineMime(); |
60 | 60 | foreach ($mimeTypes as $mimeType) { |
61 | 61 | if ($mimeType === $mime) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $height = $size[1]; |
49 | 49 | |
50 | 50 | if ($constraint->minWidth) { |
51 | - if (!ctype_digit((string) $constraint->minWidth)) { |
|
51 | + if (!ctype_digit((string)$constraint->minWidth)) { |
|
52 | 52 | throw new Exception(sprintf('"%s" is not a valid minimum width', |
53 | 53 | $constraint->minWidth)); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($constraint->maxWidth) { |
67 | - if (!ctype_digit((string) $constraint->maxWidth)) { |
|
67 | + if (!ctype_digit((string)$constraint->maxWidth)) { |
|
68 | 68 | throw new Exception(sprintf('"%s" is not a valid maximum width', |
69 | 69 | $constraint->maxWidth)); |
70 | 70 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | } |
81 | 81 | if ($constraint->minHeight) { |
82 | - if (!ctype_digit((string) $constraint->minHeight)) { |
|
82 | + if (!ctype_digit((string)$constraint->minHeight)) { |
|
83 | 83 | throw new Exception(sprintf('"%s" is not a valid minimum height', |
84 | 84 | $constraint->minHeight)); |
85 | 85 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | } |
96 | 96 | if ($constraint->maxHeight) { |
97 | - if (!ctype_digit((string) $constraint->maxHeight)) { |
|
97 | + if (!ctype_digit((string)$constraint->maxHeight)) { |
|
98 | 98 | throw new Exception(sprintf('"%s" is not a valid maximum height', |
99 | 99 | $constraint->maxHeight)); |
100 | 100 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | $ratio = round($width / $height, 2); |
110 | 110 | if (null !== $constraint->minRatio) { |
111 | - if (!is_numeric((string) $constraint->minRatio)) { |
|
111 | + if (!is_numeric((string)$constraint->minRatio)) { |
|
112 | 112 | throw new Exception(sprintf('"%s" is not a valid minimum ratio', |
113 | 113 | $constraint->minRatio)); |
114 | 114 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | if (null !== $constraint->maxRatio) { |
124 | - if (!is_numeric((string) $constraint->maxRatio)) { |
|
124 | + if (!is_numeric((string)$constraint->maxRatio)) { |
|
125 | 125 | throw new Exception(sprintf('"%s" is not a valid maximum ratio', |
126 | 126 | $constraint->maxRatio)); |
127 | 127 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | return static::transformFileName($path, $extension); |
40 | 40 | } |
41 | 41 | |
42 | - throw new \RuntimeException(__METHOD__.' needs a UploadedFile|SplFileInfo|string instance or a file path string'); |
|
42 | + throw new \RuntimeException(__METHOD__ . ' needs a UploadedFile|SplFileInfo|string instance or a file path string'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -16,6 +16,6 @@ |
||
16 | 16 | */ |
17 | 17 | public static function transformFileName($path, $extension) |
18 | 18 | { |
19 | - return date('Y-m-d-').md5($path.time()).'.'.$extension; |
|
19 | + return date('Y-m-d-') . md5($path . time()) . '.' . $extension; |
|
20 | 20 | } |
21 | 21 | } |
@@ -17,6 +17,6 @@ |
||
17 | 17 | { |
18 | 18 | $name = pathinfo($path, PATHINFO_FILENAME); |
19 | 19 | |
20 | - return $name.'.'.$extension; |
|
20 | + return $name . '.' . $extension; |
|
21 | 21 | } |
22 | 22 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | public function getDefaultMediaGenericUrl() |
122 | 122 | { |
123 | 123 | return \asset('/images/' |
124 | - .$this->getRecord()->getManager()->getTable().'/' |
|
124 | + .$this->getRecord()->getManager()->getTable() . '/' |
|
125 | 125 | .$this->getDefaultFileName()); |
126 | 126 | } |
127 | 127 | |
@@ -133,6 +133,6 @@ discard block |
||
133 | 133 | $name = inflector()->singularize($this->getName()); |
134 | 134 | $extension = $this->getName() == 'logos' ? 'png' : 'jpg'; |
135 | 135 | |
136 | - return $name.'.'.$extension; |
|
136 | + return $name . '.' . $extension; |
|
137 | 137 | } |
138 | 138 | } |