refactor: remove builder class and use concrete class

tests: added more unit tests for event processor
This commit is contained in:
2018-10-27 01:19:34 -05:00
parent f239099d55
commit 5201db7d22
15 changed files with 834 additions and 166 deletions

62
src/Config.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
namespace Aerex\TaskwarriorPlugin;
class Config {
public function __construct(){
}
public function getTaskwarriorInstance(){
if(!$this->isValidConfiguration()){
$invalidConfigurationString = $this->invalidConfigurations();
$invalidConfigurationMessage = sprintf('The following configurations are invalid %s and' .
' the default configurations will be used', $invalidConfigurationString);
echo($invalidConfigurationMessage);
$this->setDefaults();
}
$this->taskrc = $this->getTaskRC();
$this->taskDataDir = $this->getTaskDataDir();
$this->taskBinFile = $this->getTaskBinFile();
$this->taskwarrior = new $Taskwarrior($this->taskrc,$this->taskdatadir, [], $this->taskbinfile);
}
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(){
}
}
?>