Browse Source

Use constant for error type

Joanhey 3 năm trước cách đây
mục cha
commit
a1891de40e
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      src/Worker.php

+ 4 - 4
src/Worker.php

@@ -491,9 +491,9 @@ class Worker
     /**
      * PHP built-in error types.
      *
-     * @var array
+     * @var array<int,string>
      */
-    protected static $_errorType = [
+    const ERROR_TYPE = [
         \E_ERROR             => 'E_ERROR',             // 1
         \E_WARNING           => 'E_WARNING',           // 2
         \E_PARSE             => 'E_PARSE',             // 4
@@ -2076,8 +2076,8 @@ class Worker
      */
     protected static function getErrorType($type)
     {
-        if(isset(self::$_errorType[$type])) {
-            return self::$_errorType[$type];
+        if(isset(self::ERROR_TYPE[$type])) {
+            return self::ERROR_TYPE[$type];
         }
 
         return '';