refactor: leverage Task and TaskManager external api methods to create task
refactor: remove uneeded configuration
This commit is contained in:
@@ -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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user