Passed
Push — develop ( 6e1cbd...b98f4a )
by Sebastian
02:28
created

ResultCollection::current()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
eloc 2
nop 0
1
<?php
2
namespace DjThossi\SmokeTestingPhp\Collection;
3
4
use DjThossi\SmokeTestingPhp\Result\Result;
5
6
class ResultCollection extends BaseCollection
7
{
8
    /**
9
     * @param Result $result
10
     */
11
    public function addResult(Result $result)
12
    {
13
        $this->addElement($result);
14
    }
15
16
    /**
17
     * @return Result
18
     */
19
    public function current()
20
    {
21
        return $this->getCurrent();
22
    }
23
24
    /**
25
     * @return array
26
     */
27
    public function asDataProviderArray()
28
    {
29
        $retValue = [];
30
        /** @var Result $result */
31
        foreach ($this as $key => $result) {
32
            $key = sprintf('#%d: %s', $key, $result->getUrl()->asString());
33
            $retValue[$key] = [$result];
34
        }
35
36
        return $retValue;
37
    }
38
}
39