<?PHP declare(strict_types = 1); /** * Custom exception class to throw when users attempt to access a page without necessary permissions. */ final class MDAccessDeniedException extends MDExpectedException { /** * Error message. * * @return string */ public function errorMessage() { //error message return 'Access denied: ' . $this->getMessage(); } }