Completed
Pull Request — master (#580)
by Greg
03:19
created

ValueProviderTask::provideMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Robo\Task;
4
5
use Robo\Result;
6
use Robo\Task\BaseTask;
7
use Robo\Collection\Collection;
8
9
class ValueProviderTask extends BaseTask
10
{
11
    protected $message = '';
12
    protected $data = [];
13
14
    public function run()
15
    {
16
        return Result::success($this, $this->message, $this->data);
17
    }
18
19
    public function provideData($key, $value)
20
    {
21
        $this->data[$key] = $value;
22
        return $this;
23
    }
24
25
    public function provideItem($value)
26
    {
27
        return $this->provideData('item', $value);
28
    }
29
30
    public function provideMessage($message)
31
    {
32
        $this->message = $message;
33
        return $this;
34
    }
35
}
36