Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / psy / psysh / src / CodeCleaner / RequirePass.php
index 0e8056116340257f59c7584dc78ac384bcc29e92..31c156a37d1f2cd170905caa5cc1a841c480ee1f 100644 (file)
@@ -79,16 +79,15 @@ class RequirePass extends CodeCleanerPass
             // @todo Shell::handleError would be better here, because we could
             // fake the file and line number, but we can't call it statically.
             // So we're duplicating some of the logics here.
-            if (E_WARNING & error_reporting()) {
+            if (E_WARNING & \error_reporting()) {
                 ErrorException::throwException(E_WARNING, 'Filename cannot be empty', null, $lineNumber);
-            } else {
-                // @todo trigger an error as fallback? this is pretty ugly…
-                // trigger_error('Filename cannot be empty', E_USER_WARNING);
             }
+            // @todo trigger an error as fallback? this is pretty ugly…
+            // trigger_error('Filename cannot be empty', E_USER_WARNING);
         }
 
-        if ($file === '' || !stream_resolve_include_path($file)) {
-            $msg = sprintf("Failed opening required '%s'", $file);
+        if ($file === '' || !\stream_resolve_include_path($file)) {
+            $msg = \sprintf("Failed opening required '%s'", $file);
             throw new FatalErrorException($msg, 0, E_ERROR, null, $lineNumber);
         }
 
@@ -97,6 +96,6 @@ class RequirePass extends CodeCleanerPass
 
     private function isRequireNode(Node $node)
     {
-        return $node instanceof Include_ && in_array($node->type, self::$requireTypes);
+        return $node instanceof Include_ && \in_array($node->type, self::$requireTypes);
     }
 }