public static function create($file, $testing = false)
{
if ($file instanceof SymfonyUploadedFile) {
return static::createFromObject($file);
}
if (is_array($file)) {
return static::createFromArray($file, $testing);
}
if (substr($file, 0, 7) == 'http://' || substr($file, 0, 8) == 'https://') {
return static::createFromUrl($file);
}
if (preg_match('#^data:[-\\w]+/[-\\w\\+\\.]+;base64#', $file)) {
return static::createFromDataURI($file);
}
return static::createFromString($file);
}