I have only this class
class Exceptions extends Exception
{
protected $message = 'Unknown exception'; // exception message
private $string; // __toString cache
protected $code = 0; // user defined exception code
protected string $file; // source filename of exception
protected int $line; // source line of exception
private $trace; // backtrace
private $previous; // previous exception if nested exception
public function __construct($message = '', $code = 0, Throwable $previous = null){
}
private function __clone(){
} // Inhibits cloning of exceptions.
final public function getMessage():string{
return "";
} // message of exception
final public function getCode():int{
return "";
} // code of exception
final public function getFile():string{
return "";
} // source filename
final public function getLine():int {
return "";
} // source line
final public function getTrace():array{
return "";
} // an array of the backtrace()
final public function getPrevious():null{
return "";
} // previous exception
final public function getTraceAsString():string{
return "";
} // formatted string of trace
// Overrideable
public function __toString():string {
return "";
} // formatted string for display
}
I should create a new class I have only this file exception-class.php
Weedpacket recommend this class
class MyException extends Exception {
// all done
}
90% of the time when I'm extending an Exception it looks just like that.
class ParseException extends DomainException {}
these errors
Cannot override final method Exception->getMessage():21
Cannot override final method Exception->getCode():25
Cannot override final method Exception->getFile():29
Cannot override final method Exception->getLine():33
Cannot override final method Exception->getTrace():37
Cannot override final method Exception->getPrevious():41
Cannot override final method Exception->getTraceAsString():45