Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add constructor and getErrorData function to AccessDenied Exception #6

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
];
}
}