Completed
Push — master ( 9d0a0b...952be3 )
by Raphaël
11:37 queued 09:42
created

CollectionKeyAccessorTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A search() 0 4 1
A keys() 0 4 1
1
<?php
2
namespace TRex\Collection;
3
4
trait CollectionKeyAccessorTrait
5
{
6
7
    /**
8
     * @param mixed $value
9
     * @param bool $isStrict
10
     * @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...
11
     */
12
    public function search($value, $isStrict = true)
13
    {
14
        return array_keys((array)$this, $value, $isStrict);
15
    }
16
17
    /**
18
     * @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...
19
     */
20
    public function keys()
21
    {
22
        return array_keys((array)$this);
23
    }
24
}