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.
Completed
Push — dev ( 925885...2441e9 )
by Андрей
06:27
created

Functions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 9

Test Coverage

Coverage 76.47%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 9
dl 0
loc 39
ccs 13
cts 17
cp 0.7647
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B executeFunction() 0 28 4
1
<?php
2
/**
3
 * @link https://github.com/old-town/old-town-workflow
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Engine;
7
8
use OldTown\PropertySet\PropertySetInterface;
9
use OldTown\Workflow\Exception\InternalWorkflowException;
10
use OldTown\Workflow\Exception\WorkflowException;
11
use OldTown\Workflow\Loader\FunctionDescriptor;
12
use OldTown\Workflow\TransientVars\TransientVarsInterface;
13
14
15
/**
16
 * Class Functions
17
 *
18
 * @package OldTown\Workflow\Engine
19
 */
20
class Functions extends AbstractEngine implements FunctionsInterface
21
{
22
    /**
23
     * @param FunctionDescriptor $function
24
     * @param TransientVarsInterface $transientVars
25
     * @param PropertySetInterface $ps
26
     *
27
     * @throws WorkflowException
28
     * @throws InternalWorkflowException
29
     */
30 4
    public function executeFunction(FunctionDescriptor $function, TransientVarsInterface $transientVars, PropertySetInterface $ps)
31
    {
32 4
        if (null !== $function) {
33 4
            $type = $function->getType();
34
35 4
            $argsOriginal = $function->getArgs();
36
37 4
            $workflowManager = $this->getWorkflowManager();
38
39 4
            $args = $workflowManager->getEngineManager()->getArgsEngine()->prepareArgs($argsOriginal, $transientVars, $ps);
40
41 4
            $provider = $workflowManager->getResolver()->getFunction($type, $args);
42
43 4
            if (null === $provider) {
44 1
                $workflowManager->getContext()->setRollbackOnly();
45
                $errMsg = 'Не загружен провайдер для функции';
46
                throw new WorkflowException($errMsg);
47
            }
48
49
            try {
50 4
                $provider->execute($transientVars, $args, $ps);
51 4
            } catch (WorkflowException $e) {
52
                $workflowManager->getContext()->setRollbackOnly();
53
                /** @var  WorkflowException $e*/
54
                throw $e;
55
            }
56 4
        }
57 4
    }
58
}
59