GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ActionException   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A containerUnavailableForServiceMethodReference() 0 9 1
A actionAlreadyRegistered() 0 4 1
A actionNotFound() 0 4 1
A actionExpressionArgumentIsMalformed() 0 19 3
1
<?php
2
/**
3
 * This file is part of the Global Trading Technologies Ltd workflow-extension-bundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * (c) fduch <[email protected]>
9
 * @date 02.08.16
10
 */
11
12
namespace Gtt\Bundle\WorkflowExtensionsBundle\Exception;
13
use Gtt\Bundle\WorkflowExtensionsBundle\Utils\ArrayUtils;
14
15
/**
16
 * Action reference runtime exception
17
 */
18
class ActionException extends RuntimeException
19
{
20
    public static function containerUnavailableForServiceMethodReference($serviceId)
21
    {
22
        return new static(
23
            sprintf(
24
                'Cannot retrieve object for action reference for service id "%s" due to ContainerInterface instance is not set',
25
                $serviceId
26
            )
27
        );
28
    }
29
30
    public static function actionAlreadyRegistered($actionName)
31
    {
32
        return new static(sprintf('Action reference with name "%s" is already registered', $actionName));
33
    }
34
35
    public static function actionNotFound($actionName)
36
    {
37
        return new static(sprintf('Action reference with name "%s" is not found in action registry', $actionName));
38
    }
39
40
    public static function actionExpressionArgumentIsMalformed($actionName, $expression, $expressionResult)
41
    {
42
        if (is_array($expressionResult) && ArrayUtils::isArrayAssoc($expressionResult)) {
43
            // assoc array
44
            $actualResultDescription = sprintf('associative array "%s"', json_encode($expressionResult));
45
        } else {
46
            // non scalar value
47
            $actualResultDescription = gettype($expressionResult);
48
        }
49
50
        return new static(
51
            sprintf('Action reference with name "%s" has expression-defined argument "%s" which'.
52
            ' result must be scalar or non-associative array. Actual result is %s',
53
                $actionName,
54
                $expression,
55
                $actualResultDescription
56
            )
57
        );
58
    }
59
}