function SplFileInfo::getContents
Returns the contents of the file.
Throws
\RuntimeException
Overrides SplFileInfo::getContents
1 method overrides SplFileInfo::getContents()
- SplFileInfo::getContents in vendor/
symfony/ finder/ SplFileInfo.php - Returns the contents of the file.
File
-
vendor/
symfony/ finder/ SplFileInfo.php, line 66
Class
- SplFileInfo
- Extends \SplFileInfo to support relative paths.
Namespace
Symfony\Component\FinderCode
public function getContents() : string {
set_error_handler(function ($type, $msg) use (&$error) {
$error = $msg;
});
try {
$content = file_get_contents($this->getPathname());
} finally {
restore_error_handler();
}
if (false === $content) {
throw new \RuntimeException($error);
}
return $content;
}