It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.
If you suppress an error, we recommend checking for the error condition explicitly:
// For example instead of@mkdir($dir);// Better useif(@mkdir($dir)===false){thrownew\RuntimeException('The directory '.$dir.' could not be created.');}
Loading history...
41
12
}
42
16
}
43
44
/**
45
* @return resource
46
*/
47
12
public function getContentsAsStream()
48
{
49
12
$stream = @fopen($this->resource, 'r');
50
51
12
if ($stream === false) {
52
4
throw new \RuntimeException('Unable to open stream resource for ' . $this->resource);
If you suppress an error, we recommend checking for the error condition explicitly: