Skip to content

Commit

Permalink
Merge pull request #236 from akrabat/update-mimetype-isvalid-value-an…
Browse files Browse the repository at this point in the history
…notation

Add object to $value parameter of MimeType::isValid()
  • Loading branch information
Ocramius committed Mar 16, 2024
2 parents 2b1cb3e + bec5e0e commit 25cc42e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/File/ExcludeMimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Laminas\Validator\File;

use Psr\Http\Message\UploadedFileInterface;

use function array_merge;
use function class_exists;
use function explode;
Expand Down Expand Up @@ -36,8 +38,8 @@ class ExcludeMimeType extends MimeType
* of mimetypes can be checked. If you give for example "image" all image
* mime types will not be accepted like "image/gif", "image/jpeg" and so on.
*
* @param string|array $value Real file to check for mimetype
* @param array $file File data from \Laminas\File\Transfer\Transfer (optional)
* @param string|array|UploadedFileInterface $value Real file to check for mimetype
* @param array $file File data from \Laminas\File\Transfer\Transfer (optional)
* @return bool
*/
public function isValid($value, $file = null)
Expand Down
5 changes: 3 additions & 2 deletions src/File/MimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Laminas\Stdlib\ErrorHandler;
use Laminas\Validator\AbstractValidator;
use Laminas\Validator\Exception;
use Psr\Http\Message\UploadedFileInterface;
use Traversable;

use function array_filter;
Expand Down Expand Up @@ -346,8 +347,8 @@ public function addMimeType($mimetype)
* of mimetypes can be checked. If you give for example "image" all image
* mime types will be accepted like "image/gif", "image/jpeg" and so on.
*
* @param string|array $value Real file to check for mimetype
* @param array $file File data from \Laminas\File\Transfer\Transfer (optional)
* @param string|array|UploadedFileInterface $value Real file to check for mimetype
* @param array $file File data from \Laminas\File\Transfer\Transfer (optional)
* @return bool
*/
public function isValid($value, $file = null)
Expand Down

0 comments on commit 25cc42e

Please sign in to comment.