Completed
Push — master ( aff582...5ac2a2 )
by Kirill
09:26
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 0
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
    public function write(Action $action)
10
    {
11
12
        $parameters = json_decode($action->getArguments(), true);
13
14
        foreach ($this->parameters as $k => $v) {
15
            $parameters[$k] = $this->parameters[$k];
16
        }
17
18
        file_put_contents($parameters['file'], $parameters['text']);
19
20
        return "File written successfully";
21
    }
22
23
    public function decideTrue()
24
    {
25
        return true;
26
    }
27
28
    public function decideFalse()
29
    {
30
        return false;
31
    }
32
}
33