<?phpnamespaceMongoDB\GridFS\Exception;useMongoDB\Exception\RuntimeException;classFileNotFoundExceptionextendsRuntimeException{/** * Thrown when a file cannot be found by its filename and revision. * * @param string $filename Filename * @param integer $revision Revision * @param string $namespace Namespace for the files collection * @return self */publicstaticfunctionbyFilenameAndRevision($filename,$revision,$namespace){returnnewstatic(sprintf('File with name "%s" and revision "%d" not found in "%s"',$filename,$revision,$namespace));}/** * Thrown when a file cannot be found by its ID. * * @param mixed $id File ID * @param string $namespace Namespace for the files collection * @return self */publicstaticfunctionbyId($id,$namespace){$json=\MongoDB\BSON\toJSON(\MongoDB\BSON\fromPHP(['_id'=>$id]));returnnewstatic(sprintf('File "%s" not found in "%s"',$json,$namespace));}}