PushBackAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A executePush() 0 8 1
1
<?php
2
/**
3
 * NextFlow (http://github.com/nextflow)
4
 *
5
 * @link http://github.com/nextflow/nextflow-php for the canonical source repository
6
 * @copyright Copyright (c) 2014-2016 NextFlow (http://github.com/nextflow)
7
 * @license https://raw.github.com/nextflow/nextflow-php/master/LICENSE MIT
8
 */
9
10
namespace NextFlow\Arrays\Action;
11
12
use NextFlow\Core\Node\NodeInterface;
13
14
/**
15
 * Pushes an element at the back of an array.
16
 */
17
final class PushBackAction extends AbstractPushAction
18
{
19
    /**
20
     * Executes the push logic.
21
     *
22
     * @param NodeInterface $node The node to push data to.
23
     * @param mixed $value The value to push.
24
     */
25
    protected function executePush(NodeInterface $node, $value)
26
    {
27
        $arrayValue = $node->getValue();
28
29
        $arrayValue[] = $value;
30
31
        $node->setValue($arrayValue);
32
    }
33
}
34