We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 17f1943 + 087e2ee commit c1f37edCopy full SHA for c1f37ed
SplFileInfo.php
@@ -66,12 +66,11 @@ public function getRelativePathname()
66
*/
67
public function getContents()
68
{
69
- $level = error_reporting(0);
+ set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
70
$content = file_get_contents($this->getPathname());
71
- error_reporting($level);
+ restore_error_handler();
72
if (false === $content) {
73
- $error = error_get_last();
74
- throw new \RuntimeException($error['message']);
+ throw new \RuntimeException($error);
75
}
76
77
return $content;
0 commit comments