/** * @param NodeInterface $node * * @return FileNode */ public function flow(NodeInterface $node) { if (!$node instanceof FileNode) { throw new InvalidArgumentException("Node: {$node} should be an instance of FileNode"); } if (substr($this->target->getPath(), -1) == '/') { $target = $this->target->getClone()->setPath($this->target->getPath() . $node->getFilename()); } else { $target = $this->target; } return $this->copyTo($node, $target); }