refactor: remove builder class and use concrete class
tests: added more unit tests for event processor
This commit is contained in:
62
src/Config.php
Normal file
62
src/Config.php
Normal 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(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user