/** * @inheritDoc */ public function flow(NodeInterface $node) { if (!$node instanceof NodeCollectionInterface) { throw new InvalidArgumentException("The supplied {$node} is not a NodeCollectionInterface"); } return $node->filter($this->callback); }
/** * @inheritDoc */ public function flow(NodeInterface $node) { if (!$node instanceof NodeCollectionInterface) { throw new InvalidArgumentException("The supplied {$node} is not a NodeCollectionInterface"); } $this->log(LogLevel::DEBUG, "Selecting the first entry from {node}", ['node' => $node]); return $node->first($this->callback); }
/** * @param NodeInterface $node * * @return LocalFile * @throws InvalidCompressionTypeException */ public function flow(NodeInterface $node) { if (!$node instanceof LocalFile) { throw new InvalidArgumentException("Node: {$node} should be an instance of LocalFile"); } $factory = new CompressionFactory(); $compressor = $factory->getDeCompressor($node->getCompression()); $this->log(LogLevel::INFO, "DeCompressing file: '{file}'", ['file' => $node]); return $compressor->decompress($node, $this->options); }
/** * @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->moveTo($node, $target); }