コード例 #1
0
ファイル: SyncQueue.php プロジェクト: narrowspark/framework
 /**
  * Get a ErrorException instance.
  *
  * @param \ParseError|\TypeError|\Throwable $exception
  *
  * @return \ErrorException
  */
 private function getErrorException($exception) : ErrorException
 {
     if ($exception instanceof ParseError) {
         $message = 'Parse error: ' . $exception->getMessage();
         $severity = E_PARSE;
     } elseif ($exception instanceof TypeError) {
         $message = 'Type error: ' . $exception->getMessage();
         $severity = E_RECOVERABLE_ERROR;
     } else {
         $message = $exception->getMessage();
         $severity = E_ERROR;
     }
     return new ErrorException($message, $exception->getCode(), $severity, $exception->getFile(), $exception->getLine());
 }
コード例 #2
0
ファイル: TypeErrorTest.php プロジェクト: esperecyan/webidl
 public function testGetCode()
 {
     $this->assertSame('TypeError', $this->object->getCode());
 }