Merge pull request #351 from thePanz/344-allow-flags-filesystem-tasks

344: allow flags filesystem tasks
This commit is contained in:
Andrés Montañez
2017-02-11 00:15:53 -03:00
committed by GitHub
6 changed files with 88 additions and 17 deletions
+27
View File
@@ -48,6 +48,33 @@ abstract class AbstractFileTask extends AbstractTask
*/
abstract protected function getParameters();
/**
* Returns the default "flags".
*
* @return null|string
*/
protected function getDefaultFlags()
{
return null;
}
/**
* Returns the flags for the current command.
*
* @return string
*/
protected function getFlags()
{
$options = $this->getOptions();
$flags = $this->getDefaultFlags();
if (array_key_exists('flags', $options) && !empty($options['flags'])) {
$flags = trim($options['flags']);
}
return empty($flags) ? '' : $flags.' ';
}
/**
* Returns a file with the placeholders replaced
*