Passed
Push — master ( 319fcb...7a107a )
by Rafael
04:41
created

ForbiddenFieldException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 0
cts 10
cp 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 3
crap 6
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Exception\GraphQL;
12
13
use Ynlo\GraphQLBundle\Definition\FieldDefinition;
14
use Ynlo\GraphQLBundle\Definition\FieldsAwareDefinitionInterface;
15
16
class ForbiddenFieldException extends SecurityException
17
{
18
    public function __construct(FieldsAwareDefinitionInterface $object, FieldDefinition $field, $message = null)
19
    {
20
        if (!$message) {
21
            $message = sprintf(
22
                'Does not have enough permissions to get %s.%s.',
23
                $object->getName(),
24
                $field->getName()
25
            );
26
        }
27
        parent::__construct($message);
28
    }
29
}
30