src/Psi.php
public function filterBy($mapper, $condition)
    {
        $this->operationChain->append(new FilterByPredicate($mapper, $condition));

        return $this;
    }
public function filterBy($mapper, $condition)
    {
        $this->operationChain->append(new FilterByPredicate($mapper, $condition));

        return $this;
    }
public function filterBy ( $ mapper , $ condition ) { $ this -> operationChain -> append ( new FilterByPredicate ( $ mapper , $ condition ) ) ; return $ this ; }
Filters the input stream by passing each element first through the mapper and the to the condition

This is useful of one for example want to filter all items, that have a certain property starting with a certain string:

<code>

$result = Psi::it($input)
->filterBy(
function (Person $p) { return $p->getName(); },
new Psi\Str\StartingWith('A')
)
->toArray()

</code>

@param callable|UnaryFunction|BinaryFunction $mapper
@param callable|UnaryFunction|BinaryFunction $condition

@return $this
Filters the input stream by passing each element first through the mapper and the to the condition