Skip to content

Commit 443d2b0

Browse files
author
Eugene Leonovich
committed
Rename Task::$type to Task::$state
1 parent 9750316 commit 443d2b0

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/Task.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
final class Task
66
{
77
private $id;
8-
private $type;
8+
private $state;
99
private $data;
1010

11-
private function __construct($id, $type, $data = null)
11+
private function __construct($id, $state, $data = null)
1212
{
1313
$this->id = $id;
14-
$this->type = $type;
14+
$this->state = $state;
1515
$this->data = $data;
1616
}
1717

@@ -27,9 +27,9 @@ public function getId()
2727
return $this->id;
2828
}
2929

30-
public function getType()
30+
public function getState()
3131
{
32-
return $this->type;
32+
return $this->state;
3333
}
3434

3535
public function getData()
@@ -39,26 +39,26 @@ public function getData()
3939

4040
public function isReady()
4141
{
42-
return States::READY === $this->type;
42+
return States::READY === $this->state;
4343
}
4444

4545
public function isTaken()
4646
{
47-
return States::TAKEN === $this->type;
47+
return States::TAKEN === $this->state;
4848
}
4949

5050
public function isDone()
5151
{
52-
return States::DONE === $this->type;
52+
return States::DONE === $this->state;
5353
}
5454

5555
public function isBuried()
5656
{
57-
return States::BURIED === $this->type;
57+
return States::BURIED === $this->state;
5858
}
5959

6060
public function isDelayed()
6161
{
62-
return States::DELAYED === $this->type;
62+
return States::DELAYED === $this->state;
6363
}
6464
}

tests/Integration/QueueTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ protected function assertTaskInstance($task)
200200
$this->assertInstanceOf('Tarantool\Queue\Task', $task);
201201
}
202202

203-
protected function assertTask($task, $expectedId, $expectedType, $expectedData)
203+
protected function assertTask($task, $expectedId, $expectedState, $expectedData)
204204
{
205205
$this->assertTaskInstance($task);
206206

207207
$this->assertSame($expectedId, $task->getId());
208-
$this->assertSame($expectedType, $task->getType());
208+
$this->assertSame($expectedState, $task->getState());
209209
$this->assertSame($expectedData, $task->getData());
210210
}
211211

tests/Unit/TaskTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testCreateFromTuple(array $tuple)
2323
$task = Task::createFromTuple($tuple);
2424

2525
$this->assertSame($tuple[0], $task->getId());
26-
$this->assertSame($tuple[1], $task->getType());
26+
$this->assertSame($tuple[1], $task->getState());
2727

2828
if (3 === count($tuple)) {
2929
$this->assertSame($tuple[2], $task->getData());

0 commit comments

Comments
 (0)