| 1 | <?php |
||
| 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 | public function decideTrue() |
||
| 24 | { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function decideFalse() |
||
| 32 | } |
||
| 33 |