From 2b67432be4b6d626341a15861a0b1e578fb832d1 Mon Sep 17 00:00:00 2001 From: DavidBadura Date: Fri, 3 Apr 2015 22:23:26 +0000 Subject: [PATCH] filter system tags --- src/Taskwarrior.php | 6 +++++- tests/TaskManagerTest.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Taskwarrior.php b/src/Taskwarrior.php index 0dbf632..c910e06 100644 --- a/src/Taskwarrior.php +++ b/src/Taskwarrior.php @@ -94,7 +94,11 @@ class Taskwarrior { $result = $this->command('_tags', $filter); - return $this->parseResult($result); + $tags = $this->parseResult($result); + + return array_values(array_filter($tags, function ($value) { + return !in_array($value, ['next', 'nocal', 'nocolor', 'nonag']); + })); } /** diff --git a/tests/TaskManagerTest.php b/tests/TaskManagerTest.php index 7208da2..11534ae 100644 --- a/tests/TaskManagerTest.php +++ b/tests/TaskManagerTest.php @@ -497,7 +497,7 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase $task1 = $this->taskManager->find($task1->getUuid()); $this->assertEquals(array('später'), $task1->getTags()); - $this->assertEquals(array('next', 'nocal', 'nocolor', 'nonag', 'später'), $this->taskwarrior->tags()); + $this->assertEquals(array('später'), $this->taskwarrior->tags()); $this->assertCount(1,$this->taskManager->filter('+später')); }