@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * The uploaded file information |
| 103 | 103 | * @var UploadFileInfo|UploadFileInfo[]|bool |
| 104 | 104 | */ |
| 105 | - protected UploadFileInfo|array|bool $uploadInfo = false; |
|
| 105 | + protected UploadFileInfo | array | bool $uploadInfo = false; |
|
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * Create new instance |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * Return the uploaded file information |
| 245 | 245 | * @return UploadFileInfo|UploadFileInfo[]|bool |
| 246 | 246 | */ |
| 247 | - public function getInfo(): UploadFileInfo|array|bool |
|
| 247 | + public function getInfo(): UploadFileInfo | array | bool |
|
| 248 | 248 | { |
| 249 | 249 | return $this->uploadInfo; |
| 250 | 250 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | * Create new instance |
| 73 | 73 | * @param array<int, string>|string $mimeTypes |
| 74 | 74 | */ |
| 75 | - public function __construct(array|string $mimeTypes) |
|
| 75 | + public function __construct(array | string $mimeTypes) |
|
| 76 | 76 | { |
| 77 | 77 | $this->mimeTypes = Arr::wrap($mimeTypes); |
| 78 | 78 | } |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * @class MimeType |
| 61 | 61 | * @package Platine\Upload\Validator\Rule |
| 62 | 62 | */ |
| 63 | -class MimeType implements RuleInterface |
|
| 64 | -{ |
|
| 63 | +class MimeType implements RuleInterface { |
|
| 65 | 64 | /** |
| 66 | 65 | * The list of allowed uploaded file mime type |
| 67 | 66 | * @var array<int, string> |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | * Create new instance |
| 73 | 72 | * @param array<int, string>|string $mimeTypes |
| 74 | 73 | */ |
| 75 | - public function __construct(array|string $mimeTypes) |
|
| 76 | - { |
|
| 74 | + public function __construct(array|string $mimeTypes) { |
|
| 77 | 75 | $this->mimeTypes = Arr::wrap($mimeTypes); |
| 78 | 76 | } |
| 79 | 77 | |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | * @param array<int, string>|string $extensions |
| 80 | 80 | * @param bool $exclude |
| 81 | 81 | */ |
| 82 | - public function __construct(array|string $extensions, bool $exclude = false) |
|
| 82 | + public function __construct(array | string $extensions, bool $exclude = false) |
|
| 83 | 83 | { |
| 84 | 84 | $this->extensions = Arr::wrap($extensions); |
| 85 | 85 | $this->exclude = $exclude; |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * @class Extension |
| 61 | 61 | * @package Platine\Upload\Validator\Rule |
| 62 | 62 | */ |
| 63 | -class Extension implements RuleInterface |
|
| 64 | -{ |
|
| 63 | +class Extension implements RuleInterface { |
|
| 65 | 64 | /** |
| 66 | 65 | * The list of allowed/forbidden extensions |
| 67 | 66 | * @var array<int, string> |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | * @param array<int, string>|string $extensions |
| 80 | 79 | * @param bool $exclude |
| 81 | 80 | */ |
| 82 | - public function __construct(array|string $extensions, bool $exclude = false) |
|
| 83 | - { |
|
| 81 | + public function __construct(array|string $extensions, bool $exclude = false) { |
|
| 84 | 82 | $this->extensions = Arr::wrap($extensions); |
| 85 | 83 | $this->exclude = $exclude; |
| 86 | 84 | } |
@@ -114,16 +114,16 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | - * {@inheritdoc} |
|
| 118 | - */ |
|
| 117 | + * {@inheritdoc} |
|
| 118 | + */ |
|
| 119 | 119 | public function getExtension(): string |
| 120 | 120 | { |
| 121 | 121 | return $this->extension; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | - * {@inheritdoc} |
|
| 126 | - */ |
|
| 125 | + * {@inheritdoc} |
|
| 126 | + */ |
|
| 127 | 127 | public function setExtension(string $name): self |
| 128 | 128 | { |
| 129 | 129 | $this->extension = strtolower($name); |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | - * {@inheritdoc} |
|
| 136 | - */ |
|
| 135 | + * {@inheritdoc} |
|
| 136 | + */ |
|
| 137 | 137 | public function getFullName(): string |
| 138 | 138 | { |
| 139 | 139 | return empty($this->extension) ? |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
| 145 | - * {@inheritdoc} |
|
| 146 | - */ |
|
| 145 | + * {@inheritdoc} |
|
| 146 | + */ |
|
| 147 | 147 | public function getMD5(): string |
| 148 | 148 | { |
| 149 | 149 | $hash = md5_file($this->getPathname()); |
@@ -151,24 +151,24 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | - * {@inheritdoc} |
|
| 155 | - */ |
|
| 154 | + * {@inheritdoc} |
|
| 155 | + */ |
|
| 156 | 156 | public function getPathname(): string |
| 157 | 157 | { |
| 158 | 158 | return parent::getPathname(); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * {@inheritdoc} |
|
| 163 | - */ |
|
| 162 | + * {@inheritdoc} |
|
| 163 | + */ |
|
| 164 | 164 | public function getSize(): int |
| 165 | 165 | { |
| 166 | 166 | return parent::getSize(); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | - * {@inheritdoc} |
|
| 171 | - */ |
|
| 170 | + * {@inheritdoc} |
|
| 171 | + */ |
|
| 172 | 172 | public function getMimeType(): string |
| 173 | 173 | { |
| 174 | 174 | if (empty($this->mimeType)) { |
@@ -187,16 +187,16 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * {@inheritdoc} |
|
| 191 | - */ |
|
| 190 | + * {@inheritdoc} |
|
| 191 | + */ |
|
| 192 | 192 | public function getName(): string |
| 193 | 193 | { |
| 194 | 194 | return $this->name; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | - * {@inheritdoc} |
|
| 199 | - */ |
|
| 198 | + * {@inheritdoc} |
|
| 199 | + */ |
|
| 200 | 200 | public function setName(string $name): self |
| 201 | 201 | { |
| 202 | 202 | $cleanName = preg_replace('/[^A-Za-z0-9\.]+/', '_', $name); |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * {@inheritdoc} |
|
| 213 | - */ |
|
| 212 | + * {@inheritdoc} |
|
| 213 | + */ |
|
| 214 | 214 | public function getError(): int |
| 215 | 215 | { |
| 216 | 216 | return $this->error; |