GetFirstMatchAction::run()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 10
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace kosuha606\HtmlUniParser\action;
5
6
/**
7
 * @package kosuha606\HtmlUniParser\action
8
 */
9
class GetFirstMatchAction extends AbstractLogicAction
10
{
11
    /**
12
     * @return array|void
13
     */
14
    public function run()
15
    {
16
        $results = $this->args[0];
17
        $result = array();
18
        foreach ($results as $r) {
19
            $result = $r;
20
            break;
21
        }
22
23
        return $result;
24
    }
25
}