Completed
Push — master ( 32410d...2cb842 )
by Kirill
08:18
created

FileWriter::decideFalse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace AppBundle\Action\Executor;
4
5
use AppBundle\Entity\Action;
6
7
class FileWriter extends BaseExecutor implements ExecutorInterface
8
{
9 1
    public function write(Action $action)
10
    {
11
12 1
        $parameters = json_decode($action->getArguments(), true);
13
14 1
        foreach ($this->parameters as $k => $v) {
15 1
            $parameters[$k] = $this->parameters[$k];
16
        }
17
18 1
        file_put_contents($parameters['file'], $parameters['text']);
19
20 1
        return "File written successfully";
21
    }
22
23 1
    public function decideTrue()
24
    {
25 1
        return true;
26
    }
27
28
    public function decideFalse()
29
    {
30
        return false;
31
    }
32
}
33