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...
25
{
26
use InvokeTrait;
27
28
/**
29
* @var FileNodeInterface
30
*/
31
private $target;
32
33
/**
34
* CopyFile constructor.
35
*
36
* @param FileNode $target
37
*/
38
9
public function __construct(FileNode $target)
39
{
40
9
$this->target = $target;
41
9
}
42
43
/**
44
* @param NodeInterface $node
45
*
46
* @return FileNode
47
*/
48
9
public function flow(NodeInterface $node)
49
{
50
9
if (!($node instanceof FileNode)) {
51
1
throw new InvalidArgumentException("Node: $node should be an instance of FileNode");
52
}
53
54
8
if (substr($this->target->getPath(), -1) == '/') {
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.