public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface
    {
        return $this->filter(
            function ($item) use ($keyOrPropertyOrMethod, $value) {
                $accessorValue = $this->extractValue(
                    $item,
                    $keyOrPropertyOrMethod
                );

                return $accessorValue === $value;
            }
        );
    }
public function where(string $keyOrPropertyOrMethod, $value): CollectionInterface
    {
        return $this->filter(
            function ($item) use ($keyOrPropertyOrMethod, $value) {
                $accessorValue = $this->extractValue(
                    $item,
                    $keyOrPropertyOrMethod
                );

                return $accessorValue === $value;
            }
        );
    }
public function where ( string $ keyOrPropertyOrMethod , $ value ) : CollectionInterface { return $ this -> filter ( function ( $ item ) use ( $ keyOrPropertyOrMethod , $ value ) { $ accessorValue = $ this -> extractValue ( $ item , $ keyOrPropertyOrMethod ) ; return $ accessorValue === $ value ; } ) ; }
Returns a collection of matching items.

@param string $keyOrPropertyOrMethod the property or method to evaluate
@param mixed  $value                 the value to match

@throws \InvalidArgumentException if property or method is not defined

@return CollectionInterface
Returns a collection of matching items .