From d465f4481e01fe1e1ab1dffbd49c0c3935036b00 Mon Sep 17 00:00:00 2001 From: Aerex Date: Sun, 28 Oct 2018 11:16:46 -0500 Subject: [PATCH] fix: removed parseiCalDateTime fix: remove jms/serializer from dep --- composer.json | 2 +- composer.lock | 27 +++++++++++++-------------- src/iCalEventProcessor.php | 13 +++++++++---- tests/iCalEventProcessorTest.php | 6 +++--- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index ea6eb24..34fe9ef 100644 --- a/composer.json +++ b/composer.json @@ -11,10 +11,10 @@ "sabre" ], "require": { + "php": ">=5.5", "sabre/dav": "~3.1.2", "davidbadura/taskwarrior": "^3.0", "sabre/vobject": "^4.0", - "jms/serializer": "^1.13", "easycorp/easy-log-handler": "^1.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 58a93eb..b448953 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f1e3c1c3defb5c3015813049f3f3294a", + "content-hash": "00583fd916fe2c7d997c69cef27b23e4", "packages": [ { "name": "davidbadura/taskwarrior", @@ -870,16 +870,16 @@ }, { "name": "sabre/dav", - "version": "3.2.3", + "version": "3.1.5", "source": { "type": "git", "url": "https://github.com/sabre-io/dav.git", - "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80" + "reference": "b5dbb56170fd4f0d8b8b1191f22950f05d306532" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/dav/zipball/a9780ce4f35560ecbd0af524ad32d9d2c8954b80", - "reference": "a9780ce4f35560ecbd0af524ad32d9d2c8954b80", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/b5dbb56170fd4f0d8b8b1191f22950f05d306532", + "reference": "b5dbb56170fd4f0d8b8b1191f22950f05d306532", "shasum": "" }, "require": { @@ -893,18 +893,15 @@ "ext-spl": "*", "lib-libxml": ">=2.7.0", "php": ">=5.5.0", - "psr/log": "^1.0", "sabre/event": ">=2.0.0, <4.0.0", "sabre/http": "^4.2.1", - "sabre/uri": "^1.0.1", - "sabre/vobject": "^4.1.0", - "sabre/xml": "^1.4.0" + "sabre/uri": "~1.0", + "sabre/vobject": "~4.0", + "sabre/xml": "~1.0" }, "require-dev": { "evert/phpdoc-md": "~0.1.0", - "monolog/monolog": "^1.18", - "phpunit/phpunit": "> 4.8, <6.0.0", - "sabre/cs": "^1.0.0" + "phpunit/phpunit": "> 4.8, <6.0.0" }, "suggest": { "ext-curl": "*", @@ -949,7 +946,7 @@ "framework", "iCalendar" ], - "time": "2018-10-19T09:58:27+00:00" + "time": "2018-10-19T09:57:45+00:00" }, { "name": "sabre/event", @@ -3036,6 +3033,8 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": { + "php": ">=5.5" + }, "platform-dev": [] } diff --git a/src/iCalEventProcessor.php b/src/iCalEventProcessor.php index 8596335..6dcb6ef 100644 --- a/src/iCalEventProcessor.php +++ b/src/iCalEventProcessor.php @@ -76,10 +76,15 @@ class iCalEventProcessor { // parse iCalendar event times to DateTime objects - $entry = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DSTAMP); - $start = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DSTART); - $modified = $this->taskwarrior->parseiCalDateTime($ToDoComponent->{'LAST-MODIFIED'}); - $end = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DTEND); + //$entry = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DSTAMP); + //$start = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DSTART); + //$modified = $this->taskwarrior->parseiCalDateTime($ToDoComponent->{'LAST-MODIFIED'}); + //$end = $this->taskwarrior->parseiCalDateTime($ToDoComponent->DTEND); + + $start = $ToDoComponent->DSTART; + $entry = $ToDoComponent->DSTAMP; + $modified = $ToDoComponent->{'LAST-MODIFIED'}; + $end = $ToDoComponent->DTEND; $task = $this->taskwarrior->createTask($ToDoComponent->UID); diff --git a/tests/iCalEventProcessorTest.php b/tests/iCalEventProcessorTest.php index badf179..2d62bf6 100644 --- a/tests/iCalEventProcessorTest.php +++ b/tests/iCalEventProcessorTest.php @@ -64,9 +64,9 @@ class iCalEventProcessorTest extends \PHPUnit\Framework\TestCase { $mockVTodo->add('DESCRIPTION', $description); $mockVTodo->add('CATEGORIES', $categories); - $this->mockTaskwarrior->expects($this->exactly(4)) - ->method('parseiCalDateTime') - ->will($this->onConsecutiveCalls($startTime, $startTime, $modifiedTime, $endTime)); +// $this->mockTaskwarrior->expects($this->exactly(4)) +// ->method('parseiCalDateTime') +// ->will($this->onConsecutiveCalls($startTime, $startTime, $modifiedTime, $endTime)); $this->mockTaskwarrior->expects($this->once())->method('createTask')->with($this->equalTo($uuid)) ->willReturn($this->mockTask);