1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00
appwrite/src/Appwrite/Storage/Validator/Upload.php
Eldad A. Fux 042660b15c
Feat psalm analysis (#699)
* Added static code analysis
* Updated code to solve psalm issue
2020-10-27 02:08:29 +02:00

34 lines
548 B
PHP

<?php
namespace Appwrite\Storage\Validator;
use Utopia\Validator;
class Upload extends Validator
{
public function getDescription()
{
return 'Not a valid upload file';
}
/**
* Check if a file is a valid upload file
*
* @param mixed $path
*
* @return bool
*/
public function isValid($path)
{
if(!is_string($path)) {
return false;
}
if (\is_uploaded_file($path)) {
return true;
}
return false;
}
}