You are here

public function SplFileInfo::getContents in Database Sanitize 7

Returns the contents of the file.

Return value

string 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 67

Class

SplFileInfo
Extends \SplFileInfo to support relative paths.

Namespace

Symfony\Component\Finder

Code

public function getContents() {
  set_error_handler(function ($type, $msg) use (&$error) {
    $error = $msg;
  });
  $content = file_get_contents($this
    ->getPathname());
  restore_error_handler();
  if (false === $content) {
    throw new \RuntimeException($error);
  }
  return $content;
}