Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public static function buildUnauthorized( |
||
50 | $id = null, |
||
51 | LinkInterface $aboutLink = null, |
||
52 | $code = null, |
||
53 | array $source = null, |
||
54 | $meta = null |
||
55 | ): Error { |
||
56 | return new Error( |
||
57 | $id ?? null, |
||
58 | $aboutLink ?? new Link('https://tools.ietf.org/html/rfc7231#section-6.5.3'), |
||
59 | '403', |
||
60 | $code ?? null, |
||
61 | 'Forbidden', |
||
62 | 'Access is denied for one or more of the specified resources', |
||
63 | $source, |
||
64 | $meta |
||
65 | ); |
||
66 | } |
||
67 | } |
||
68 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.