public function MockSplFileInfo::__construct in Database Sanitize 7
File
- vendor/
symfony/ finder/ Tests/ Iterator/ MockSplFileInfo.php, line 26
Class
Namespace
Symfony\Component\Finder\Tests\IteratorCode
public function __construct($param) {
if (\is_string($param)) {
parent::__construct($param);
}
elseif (\is_array($param)) {
$defaults = array(
'name' => 'file.txt',
'contents' => null,
'mode' => null,
'type' => null,
'relativePath' => null,
'relativePathname' => null,
);
$defaults = array_merge($defaults, $param);
parent::__construct($defaults['name']);
$this
->setContents($defaults['contents']);
$this
->setMode($defaults['mode']);
$this
->setType($defaults['type']);
$this
->setRelativePath($defaults['relativePath']);
$this
->setRelativePathname($defaults['relativePathname']);
}
else {
throw new \RuntimeException(sprintf('Incorrect parameter "%s"', $param));
}
}