Skip to content

Commit

Permalink
Merge pull request #6 from PeterMis/master
Browse files Browse the repository at this point in the history
Add constructor and getErrorData function to AccessDenied Exception
  • Loading branch information
dasgarner authored Apr 24, 2020
2 parents 9457f7c + bbd5e21 commit 3112507
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/Xibo/Support/Exception/AccessDeniedException.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
<?php
/**
* Copyright (c) 2019 Xibo Signage Ltd
* Copyright (c) 2020 Xibo Signage Ltd
*/

namespace Xibo\Support\Exception;


class AccessDeniedException extends GeneralException
{
protected $help;

/**
* AccessDeniedException constructor.
* @param string $message
* @param string $help
*/
public function __construct($message = '', $help = null)
{
$this->help = $help;

parent::__construct($message, 403, null);
}

public function getHttpStatusCode()
{
return 403;
}

/**
* @return array
*/
protected function getErrorData()
{
return [
'help' => $this->help
];
}
}

0 comments on commit 3112507

Please sign in to comment.