refactor: leverage Task and TaskManager external api methods to create task

refactor: remove uneeded configuration
This commit is contained in:
2018-10-28 00:11:01 -05:00
parent 5201db7d22
commit 88a78aeae7
4 changed files with 138 additions and 87 deletions

View File

@@ -2,61 +2,56 @@
namespace Aerex\TaskwarriorPlugin;
use DavidBadura\Taskwarrior\Taskwarrior;
use Aerex\Taskwarrior\TaskwarriorManager;
class Config {
public function __construct(){
/**
* @var string
*/
private $bin;
}
/**
* @var string
*/
private $taskrc;
public function getTaskwarriorInstance(){
/**
* @var string
*/
private $taskData;
if(!$this->isValidConfiguration()){
$invalidConfigurationString = $this->invalidConfigurations();
/**
* @var array
*/
private $rcOptions;
$invalidConfigurationMessage = sprintf('The following configurations are invalid %s and' .
' the default configurations will be used', $invalidConfigurationString);
echo($invalidConfigurationMessage);
$this->setDefaults();
public function __construct($taskrc='~/.taskrc', $taskData='~/.task',$rcOptions = [], $bin='task'){
$this->taskrc = $taskrc;
$this->bin = $bin;
$this->taskDat = $taskData;
$this->rcOptions = $rcOptions;
}
$this->taskrc = $this->getTaskRC();
$this->taskDataDir = $this->getTaskDataDir();
$this->taskBinFile = $this->getTaskBinFile();
public function getTaskwarriorInstance(){
$this->taskwarrior = new $Taskwarrior($this->taskrc,$this->taskdatadir, [], $this->taskbinfile);
}
$this->taskwarrior = new Taskwarrior($this->taskrc,$this->taskdatadir, [], $this->taskbinfile);
$this->taskwarriorManager = new TaskwarriorManager($this->taskwarrior);
return $this->taskwarriorManager;
}
public function getLogger(){
return $this->logger;
}
public function setLogger($logger){
$this->logger = $logger;
public function getLogger(){
return $this->logger;
}
public function setLogger($logger){
$this->logger = $logger;
}
public function isValidConfigurations(){
}
public function setDefaults(){
}
public function getTaskRC() {
}
public function getTaskDataDir(){
}
public function getTaskBinFile(){
}
}
}
?>