X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FException%2FTypeErrorException.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FException%2FTypeErrorException.php;h=fe7ef129419fd55974ce5fd115ae1147917bad9a;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/psy/psysh/src/Exception/TypeErrorException.php b/vendor/psy/psysh/src/Exception/TypeErrorException.php new file mode 100644 index 000000000..fe7ef1294 --- /dev/null +++ b/vendor/psy/psysh/src/Exception/TypeErrorException.php @@ -0,0 +1,55 @@ +rawMessage = $message; + $message = preg_replace('/, called in .*?: eval\\(\\)\'d code/', '', $message); + parent::__construct(sprintf('TypeError: %s', $message), $code); + } + + /** + * Get the raw (unformatted) message for this error. + * + * @return string + */ + public function getRawMessage() + { + return $this->rawMessage; + } + + /** + * Create a TypeErrorException from a TypeError. + * + * @param \TypeError $e + * + * @return TypeErrorException + */ + public static function fromTypeError(\TypeError $e) + { + return new self($e->getMessage(), $e->getLine()); + } +}