Completed
Push — master ( b96c3f...17a0ce )
by Florian
15s queued 11s
created

src/Link/IntersectKey.php (1 issue)

1
<?php
2
3
namespace Cocur\Chain\Link;
4
5
use Cocur\Chain\Chain;
6
7
/**
8
 * IntersectKey.
9
 *
10
 * @author    Florian Eckerstorfer
11
 * @copyright 2015-2018 Florian Eckerstorfer
12
 */
13
trait IntersectKey
14
{
15
    /**
16
     * @param Chain|array $array
17
     *
18
     * @return self
19
     */
20 2
    public function intersectKey($array): self
21
    {
22 2
        $this->array = array_intersect_key($this->array, $array instanceof Chain ? $array->array : $array);
1 ignored issue
show
Bug Best Practice introduced by
The property array does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23
24 2
        return $this;
25
    }
26
}
27