refactor: clean up code and remove some dependencies

This commit is contained in:
2018-11-25 17:35:33 -06:00
parent 2d2122e05d
commit 98b67855ca
19 changed files with 1075 additions and 565 deletions

View File

@@ -3,13 +3,13 @@
namespace Aerex\TaskwarriorPlugin;
use Sabre\DAV\Exception\BadRequest;
use Sabre\VObject\Document;
use Sabre\VObject\Component\VCalendar;
use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;
use Sabre\Xml\ParseException;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Server;
use Aerex\TaskwarriorPlugin\iCalEventProcessor;
use Aerex\TaskwarriorPlugin\CalendarProcessor;
use Aerex\TaskwarriorPlugin\Config;
/**
@@ -49,7 +49,7 @@ class Plugin extends ServerPlugin {
if(!is_null($TWCalManager)){
$this->twCalManager = $TWCalManager;
} else {
$this->twCalManager = new iCalEventProcessor();
$this->twCalManager = new CalendarProcessor();
}
}
@@ -100,7 +100,7 @@ class Plugin extends ServerPlugin {
*
* @param VCalendar $vCal parsed calendar object
*/
function processCalendarEventForTaskwarrior(Document $vCal){
function processCalendarEventForTaskwarrior(VCalendar $vCal){
try {
$this->twCalManager->importTask($vCal->VTODO);
} catch(BadRequest $e){