FileExecutor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getExecuteFileCallable() 0 3 1
A resultSetToArray() 0 3 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Db3v4l\Core\SqlExecutor\InProcess;
4
5
use Db3v4l\API\Interfaces\SqlExecutor\InProcess\CommandExecutor as InProcessCommandExecutor;
6
use Db3v4l\API\Interfaces\SqlExecutor\InProcess\FileExecutor as InProcessFileExecutor;
7
8
/**
9
 * Executes sql commands stored in a file by reading the file and passing the commands in it to a command executor
10
 * @todo if/when we will have executors that can deal with single sql statements but not commands, this one could
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
11
 *       eventually attempt to split the command in statements
12
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
13
class FileExecutor implements InProcessFileExecutor
14
{
15
    /** @var InProcessCommandExecutor $wrappedExecutor */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
16
    protected $wrappedExecutor;
17
18
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
     * @param InProcessCommandExecutor $wrappedExecutor
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
20
     */
21
    public function __construct($wrappedExecutor)
22
    {
23
        $this->wrappedExecutor = $wrappedExecutor;
24
    }
25
26
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
27
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value for @param tag indented incorrectly; expected 2 spaces but found 1
Loading history...
28
     * @return Callable
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
29
     */
30
    public function getExecuteFileCallable($filename)
31
    {
32
        return $this->wrappedExecutor->getExecuteCommandCallable(file_get_contents($filename));
33
    }
34
35
    public function resultSetToArray($data)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function resultSetToArray()
Loading history...
36
    {
37
        return $this->wrappedExecutor->resultSetToArray($data);
38
    }
39
}
40