-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathIsNotEnabled.php
44 lines (39 loc) · 1.1 KB
/
IsNotEnabled.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Unleash\Client\Bundle\Attribute;
use Attribute;
use JetBrains\PhpStorm\ExpectedValues;
use Symfony\Component\HttpFoundation\Response;
/**
* @todo Make readonly in next major
*/
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)]
final class IsNotEnabled implements ControllerAttribute
{
public function __construct(
public string $featureName,
#[ExpectedValues([
Response::HTTP_NOT_FOUND,
Response::HTTP_FORBIDDEN,
Response::HTTP_BAD_REQUEST,
Response::HTTP_UNAUTHORIZED,
Response::HTTP_SERVICE_UNAVAILABLE,
])]
public int $errorCode = Response::HTTP_NOT_FOUND,
) {
}
public function getFeatureName(): string
{
return $this->featureName;
}
#[ExpectedValues([
Response::HTTP_NOT_FOUND,
Response::HTTP_FORBIDDEN,
Response::HTTP_BAD_REQUEST,
Response::HTTP_UNAUTHORIZED,
Response::HTTP_SERVICE_UNAVAILABLE,
])]
public function getErrorCode(): int
{
return $this->errorCode;
}
}