feat: Updated sabre/dev dependency to 3.2.3
- feat: Updated nestbot/carbon to 2.0.0 - fix: Replaced zendframework/zend-validator with laminas/laminas-validator - fix: Replaced zendframework/zend-stdlib with laminas/laminas-stdlib
This commit is contained in:
parent
6657fab031
commit
75ccc2d316
@ -9,18 +9,24 @@
|
||||
"Baikal",
|
||||
"sabre"
|
||||
],
|
||||
|
||||
"repositories": [{"type": "vcs", "url": "https://aerex.me/git/Aerex/Taskwarrior"}],
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.aerex.me/Aerex/Taskwarrior"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5",
|
||||
"sabre/dav": "~3.1.2",
|
||||
"sabre/dav": "~3.2.3",
|
||||
"sabre/vobject": "^4.0",
|
||||
"easycorp/easy-log-handler": "^1.0",
|
||||
"zendframework/zend-validator": "^2.10",
|
||||
"nesbot/carbon": "^1.14"
|
||||
"nesbot/carbon": "^2.0.0",
|
||||
"laminas/laminas-validator": "^2.13",
|
||||
"laminas/laminas-stdlib": "^3.2",
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit" : "> 4.8, <=6.0.0"
|
||||
"phpunit/phpunit": "> 4.8, <=6.0.0"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
|
846
composer.lock
generated
846
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -10,19 +10,19 @@ use Aerex\TaskwarriorPlugin\Exceptions\TaskwarriorCommandException;
|
||||
|
||||
|
||||
class TodoStrategy implements IStrategy {
|
||||
private $config;
|
||||
private $config;
|
||||
|
||||
public function __construct(Config $config){
|
||||
public function __construct(Config $config){
|
||||
$this->config = $config;
|
||||
}
|
||||
}
|
||||
|
||||
public function count($uuid){
|
||||
public function count($uuid){
|
||||
$cmd[] = $this->config->getTaskBin();
|
||||
$cmd[] = sprintf('%s count', $uuid);
|
||||
return $this->executeCommand($cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public function modify($task){
|
||||
public function modify($task){
|
||||
$cmd[] = $this->config->getTaskBin();
|
||||
|
||||
$uuid = $task->getUuid();
|
||||
@ -48,9 +48,9 @@ public function modify($task){
|
||||
|
||||
return $this->executeCommand($cmd);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function add(Task $task){
|
||||
public function add(Task $task){
|
||||
$cmd[] = $this->config->getTaskBin();
|
||||
$cmd[] = 'add';
|
||||
|
||||
@ -80,12 +80,12 @@ public function add(Task $task){
|
||||
}
|
||||
|
||||
return $this->executeCommand($cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function executeCommand($command){
|
||||
private function executeCommand($command){
|
||||
$rcOptions = $this->config->getOptions();
|
||||
|
||||
foreach ($rcOptions as $rcOption) {
|
||||
@ -109,7 +109,7 @@ private function executeCommand($command){
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Aerex\TaskwarriorPlugin\TW;
|
||||
use Zend\Validator\Uuid;
|
||||
use Laminas\Validator\Uuid
|
||||
use Carbon\Carbon;
|
||||
use Sabre\VObject\Component\VTodo;
|
||||
|
||||
@ -11,7 +11,7 @@ use Sabre\VObject\Component\VTodo;
|
||||
*/
|
||||
class Task {
|
||||
|
||||
/**
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @JMS\Type("string")
|
||||
@ -175,12 +175,12 @@ class Task {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*
|
||||
* If description is not available attempt to summary, otherwise throw Exception
|
||||
*/
|
||||
public function setDescription(VTodo $component){
|
||||
public function setDescription(VTodo $component){
|
||||
if(!isset($component->DESCRIPTION) && isset($component->SUMMARY)){
|
||||
$this->description = $component->SUMMARY;
|
||||
} else if(!isset($component->DESCRIPTION) && !isset($component->SUMMARY)){
|
||||
@ -189,13 +189,13 @@ public function setDescription(VTodo $component){
|
||||
$this->description = $component->DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getDescription(){
|
||||
public function getDescription(){
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
|
||||
public function setEntryTime(VTodo $document){
|
||||
public function setEntryTime(VTodo $document){
|
||||
|
||||
if(isset($document->DTSTAMP)){
|
||||
$this->entry = new Carbon($document->DTSTAMP->getDateTime()->format(\DateTime::W3C));
|
||||
@ -203,68 +203,68 @@ public function setEntryTime(VTodo $document){
|
||||
throw new Exception('Task must have a entry time');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getEntryTime(){
|
||||
public function getEntryTime(){
|
||||
return $this->entry;
|
||||
}
|
||||
}
|
||||
|
||||
public function setStartTime(VTodo $document){
|
||||
public function setStartTime(VTodo $document){
|
||||
if(isset($document->DTSTART)){
|
||||
$this->start = new Carbon($document->DTSTART->getDateTime()->format(\DateTime::W3C));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getStartTime(){
|
||||
public function getStartTime(){
|
||||
return $this->start;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function setModifiedTime(VTodo $document){
|
||||
public function setModifiedTime(VTodo $document){
|
||||
if(isset($document->{'LAST-MODIFIED'})){
|
||||
$this->modified = new Carbon($document->{'LAST-MODIFIED'}->getDateTime()->format(\DateTime::W3C));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getModifiedTime(){
|
||||
public function getModifiedTime(){
|
||||
return $this->modified;
|
||||
}
|
||||
}
|
||||
|
||||
public function setDue(VTodo $document){
|
||||
public function setDue(VTodo $document){
|
||||
|
||||
if(isset($document->DUE)){
|
||||
$this->due = new Carbon($document->DUE->getDateTime()->format(\DateTime::W3C));
|
||||
}
|
||||
}
|
||||
public function getDue($format=null){
|
||||
}
|
||||
public function getDue($format=null){
|
||||
if($format != null){
|
||||
return $this->due->format($format);
|
||||
}
|
||||
|
||||
return $this->due;
|
||||
}
|
||||
}
|
||||
|
||||
public function setStopTime(VTodo $document){
|
||||
public function setStopTime(VTodo $document){
|
||||
if(isset($document->DTEND)){
|
||||
$this->end = new Carbon($document->DTEND->getDateTime()->format(\DateTime::W3C));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getStopTime(){
|
||||
public function getStopTime(){
|
||||
return $this->end;
|
||||
}
|
||||
}
|
||||
|
||||
public function setCategories(VTodo $document){
|
||||
public function setCategories(VTodo $document){
|
||||
if(isset($document->CATEGORIES)){
|
||||
$this->tags = explode(',', (string)$document->CATEGORIES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCategories(){
|
||||
public function getCategories(){
|
||||
return $this->tags;
|
||||
}
|
||||
}
|
||||
|
||||
public function setStatus(VTodo $document){
|
||||
public function setStatus(VTodo $document){
|
||||
if(isset($document->STATUS)){
|
||||
switch((string)$document->STATUS){
|
||||
case 'NEEDS-ACTION':
|
||||
@ -278,25 +278,20 @@ public function setStatus(VTodo $document){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getRecurrence(){
|
||||
public function getRecurrence(){
|
||||
return $this->recur;
|
||||
|
||||
}
|
||||
public function setRecurrence(VTodo $document){
|
||||
}
|
||||
public function setRecurrence(VTodo $document){
|
||||
if(isset($document->RRULE)){
|
||||
$this->recur = $document->RRULE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getStatus(){
|
||||
public function getStatus(){
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ class TaskwarriorManager {
|
||||
|
||||
$updatedTask = $this->taskwarrior->modify($task);
|
||||
|
||||
return $upatedTask;
|
||||
return $updatedTask;
|
||||
}
|
||||
|
||||
public function taskExists($taskUuid){
|
||||
|
@ -1,14 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Sabre\VObject\Component\VCalendar;
|
||||
use Sabre\DAV\Exception\BadRequest;
|
||||
use Aerex\TaskwarriorPlugin\Taskwarrior\Task;
|
||||
use Aerex\TaskwarriorPlugin\Plugin;
|
||||
use Carbon\Carbon;
|
||||
use Aerex\TaskwarriorPlugin\Config;
|
||||
use Sabre\DAV\Server;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
|
||||
class TaskTest extends \PHPUnit\Framework\TestCase {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user