This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
23
{
24
use InvokeTrait;
25
26
/**
27
* @param string $lines Number of lines to tail (accepts +/- modifiers)
28
* @param array $options List of options:
29
* -postfix <string> (Default: tail)
30
* -keepOldFile <bool> (Default: true)
31
*/
32
4
public function __construct($lines, array $options = [])
33
{
34
4
$this->lines = $lines;
35
4
$this->options = $options;
36
4
}
37
38
/**
39
* Run a 'flow' through the handler
40
*
41
* @param NodeInterface $node
42
*
43
* @return LocalFile
44
*/
45
4
public function flow(NodeInterface $node)
46
{
47
4
if (!($node instanceof LocalFile)) {
48
1
throw new InvalidArgumentException("Node: $node should be an instance of LocalFile");
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.