style: remove unused code and updated plugin

This commit is contained in:
2018-11-26 00:58:20 -06:00
parent a2b2073bad
commit 68470e3dee
8 changed files with 108 additions and 840 deletions

View File

@@ -8,17 +8,11 @@ use Sabre\VObject\Component\VTodo;
class TaskwarriorManager {
const DESCRIPTION = 'description';
const CATEGORIES = 'categories';
const TASK_UUID = 'uuid';
const ICAL_UID = 'uid';
private $tasks;
const ENTRY = 'entry';
const START = 'start';
const MODIFIED = 'modified';
const END = 'end';
/**
* @var TodoStrategy
*/
private $todoStrategy;
public function __construct($taskwarrior){
if(!isset($taskwarrior)){
@@ -26,39 +20,29 @@ class TaskwarriorManager {
} else {
$this->taskwarrior = $taskwarrior;
}
// Initialize strategies
$this->todoStrategy = new TodoStrategy($this->taskwarrior->getConfig());
}
public function createTask($UUID){
$task = new Task();
}
public function export(VTodo $document){
}
public function addTask(VTodo $document){
$this->taskwarrior->setStrategy($this->todoStrategy);
$task = $this->taskwarrior->createTask((string)$document->UID);
$task = $this->taskwarrior->createTask((string)$document->UID);
$task->setDescription($document);
$task->setDescription($document);
$task->setEntry($document);
$task->setEntryTime($document);
$task->setStartTime($document);
$task->setDue($document);
$task->setModifiedTime($document);
$task->setCategories($document);
$task->setStopTime($document);
$task->setStatus($document);
$task->setDue($document);
$task->setRecurrence($document);
$task->setCategories($document);
$task->setStatus($document);
$task->setRecurrence($document);
return $this->taskwarrior->add($task);
return $this->taskwarrior->add($task);
}
@@ -89,73 +73,11 @@ class TaskwarriorManager {
return $upatedTask;
}
function setEntryTime($entry){
}
function exists($UUID){}
function setEndTime($end){}
function setModifiedTime($modifiedTime){}
function setSummary($description){
if(!isset($description)){
return;
}
$this->taskWarriorJSON[self::DESCRIPTION] = $description;
}
function setStartTime($startTime){}
function setCategories($categories){
if(!isset($categories)){
return;
}
if(!is_array($catergories)){
return;
}
$this->taskWarriorJSON[self::CATEGORIES] = $categories;
}
public function taskExists($taskUuid){
$taskIsInCache = isset($this->cachedTasks[$taskUuid]);
if($taskIsInCache){
return true;
}
$jsonArray = $this->taskwarrior->export($taskUuid);
$taskWithUuidExists = count($jsonArray) > 0;
return $taskWithUuidExists;
$this->taskwarrior->setStrategy($this->$todoStrategy);
return $this->taskwarrior->count((string)$taskUuid);
}
public function save(){
}
public function build(){
}
/**
* @param Task $task
* @param string $attr
* @param mixed $value
*/
public function setValue(Task $task, $attr, $value)
{
$refClass = new \ReflectionClass(Task::class);
$refProp = $refClass->getProperty($attr);
$refProp->setAccessible(true);
$refProp->setValue($task, $value);
}
function setDescription($description){}
function parseiCalDateTime($iCalDateTime){}
function convertToStringArray($categories){}
}
?>