PHP 8 Compatibility

This commit is contained in:
Frédéric Guillot
2022-02-05 11:49:03 -08:00
committed by GitHub
parent 61e63ef9e0
commit f5bb55bdb8
558 changed files with 6262 additions and 21691 deletions

View File

@@ -38,7 +38,7 @@ class SplFileInfo extends \SplFileInfo
*
* This path does not contain the file name.
*
* @return string the relative path
* @return string
*/
public function getRelativePath()
{
@@ -50,7 +50,7 @@ class SplFileInfo extends \SplFileInfo
*
* This path contains the file name.
*
* @return string the relative path name
* @return string
*/
public function getRelativePathname()
{
@@ -67,15 +67,18 @@ class SplFileInfo extends \SplFileInfo
/**
* Returns the contents of the file.
*
* @return string the contents of the file
* @return string
*
* @throws \RuntimeException
*/
public function getContents()
{
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
$content = file_get_contents($this->getPathname());
restore_error_handler();
try {
$content = file_get_contents($this->getPathname());
} finally {
restore_error_handler();
}
if (false === $content) {
throw new \RuntimeException($error);
}