CollectionKeyAccessorTrait::keys()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace TRex\Collection;
3
4
trait CollectionKeyAccessorTrait
5
{
6
    /**
7
     * @param mixed $value
8
     * @param bool $isStrict
9
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<integer|string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
10
     */
11 2
    public function search($value, $isStrict = true)
12
    {
13 2
        return array_keys((array)$this, $value, $isStrict);
14
    }
15
16
    /**
17
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<integer|string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
18
     */
19 3
    public function keys()
20
    {
21 3
        return array_keys((array)$this);
22
    }
23
}