@@ -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) { |
@@ -74,9 +74,9 @@ |
||
74 | 74 | |
75 | 75 | protected function getDefaultFilterFunction(array $filters): Closure |
76 | 76 | { |
77 | - return function (Media $media) use ($filters) { |
|
77 | + return function(Media $media) use ($filters) { |
|
78 | 78 | foreach ($filters as $property => $value) { |
79 | - if (! Arr::has($media->custom_properties, $property)) { |
|
79 | + if (!Arr::has($media->custom_properties, $property)) { |
|
80 | 80 | return false; |
81 | 81 | } |
82 | 82 |
@@ -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( |
53 | 53 | '"%s" is not a valid minimum width', |
54 | 54 | $constraint->minWidth |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($constraint->maxWidth) { |
69 | - if (!ctype_digit((string) $constraint->maxWidth)) { |
|
69 | + if (!ctype_digit((string)$constraint->maxWidth)) { |
|
70 | 70 | throw new Exception(sprintf( |
71 | 71 | '"%s" is not a valid maximum width', |
72 | 72 | $constraint->maxWidth |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | } |
85 | 85 | if ($constraint->minHeight) { |
86 | - if (!ctype_digit((string) $constraint->minHeight)) { |
|
86 | + if (!ctype_digit((string)$constraint->minHeight)) { |
|
87 | 87 | throw new Exception(sprintf( |
88 | 88 | '"%s" is not a valid minimum height', |
89 | 89 | $constraint->minHeight |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | } |
102 | 102 | if ($constraint->maxHeight) { |
103 | - if (!ctype_digit((string) $constraint->maxHeight)) { |
|
103 | + if (!ctype_digit((string)$constraint->maxHeight)) { |
|
104 | 104 | throw new Exception(sprintf( |
105 | 105 | '"%s" is not a valid maximum height', |
106 | 106 | $constraint->maxHeight |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | $ratio = round($width / $height, 2); |
118 | 118 | if (null !== $constraint->minRatio) { |
119 | - if (!is_numeric((string) $constraint->minRatio)) { |
|
119 | + if (!is_numeric((string)$constraint->minRatio)) { |
|
120 | 120 | throw new Exception(sprintf( |
121 | 121 | '"%s" is not a valid minimum ratio', |
122 | 122 | $constraint->minRatio |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | if (null !== $constraint->maxRatio) { |
134 | - if (!is_numeric((string) $constraint->maxRatio)) { |
|
134 | + if (!is_numeric((string)$constraint->maxRatio)) { |
|
135 | 135 | throw new Exception(sprintf( |
136 | 136 | '"%s" is not a valid maximum ratio', |
137 | 137 | $constraint->maxRatio |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ); |
59 | 59 | $files = []; |
60 | 60 | foreach ($mediaRecords as $mediaRecord) { |
61 | - $files[] = new File($this->getFilesystem(),$mediaRecord->path); |
|
61 | + $files[] = new File($this->getFilesystem(), $mediaRecord->path); |
|
62 | 62 | } |
63 | 63 | return $files; |
64 | 64 | } |
@@ -21,12 +21,12 @@ |
||
21 | 21 | * @param Collection|string $collection |
22 | 22 | * @return MediaProperty|Record |
23 | 23 | */ |
24 | - public function for(Record $model, $collection) |
|
24 | + public function for (Record $model, $collection) |
|
25 | 25 | { |
26 | 26 | $collection = is_object($collection) ? $collection->getName() : $collection; |
27 | 27 | if ($model->hasRelation('MediaProperties')) { |
28 | 28 | return $model->getRelation('MediaProperties')->getResults()->filter( |
29 | - function ($item) use ($collection) { |
|
29 | + function($item) use ($collection) { |
|
30 | 30 | return $item->collection_name == $collection; |
31 | 31 | } |
32 | 32 | )->current(); |
@@ -23,13 +23,13 @@ |
||
23 | 23 | * @param $collection |
24 | 24 | * @return MediaProperty[]|Collection |
25 | 25 | */ |
26 | - public function for(Record $model, $collection) |
|
26 | + public function for (Record $model, $collection) |
|
27 | 27 | { |
28 | 28 | $collection = is_object($collection) ? $collection->getName() : $collection; |
29 | 29 | |
30 | 30 | if ($model->hasRelation('Media')) { |
31 | 31 | return $model->getRelation('Media')->getResults()->filter( |
32 | - function ($item) use ($collection) { |
|
32 | + function($item) use ($collection) { |
|
33 | 33 | return $item->collection_name == $collection; |
34 | 34 | } |
35 | 35 | ); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | protected function initHasAcceptsMediaWithValidation() |
31 | 31 | { |
32 | - $this->acceptsMedia(function ($file) { |
|
32 | + $this->acceptsMedia(function($file) { |
|
33 | 33 | $validator = $this->getValidator(); |
34 | 34 | $constraint = $this->getConstraint(); |
35 | 35 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | protected function initHasAcceptsMediaEmpty() |
46 | 46 | { |
47 | - $this->acceptsMedia(function () { |
|
47 | + $this->acceptsMedia(function() { |
|
48 | 48 | return true; |
49 | 49 | }); |
50 | 50 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | public function getByName(string $name): Conversion |
14 | 14 | { |
15 | - $conversion = $this->first(function (Conversion $conversion) use ($name) { |
|
15 | + $conversion = $this->first(function(Conversion $conversion) use ($name) { |
|
16 | 16 | return $conversion->getName() === $name; |
17 | 17 | }); |
18 | 18 |