src/Collection.php
public function takeWhile(callable $condition)
    {
        $count = $this->countWhileTrue($condition);

        return $count ? $this->take($count) : $this->clear();
    }
public function takeWhile(callable $condition)
    {
        $count = $this->countWhileTrue($condition);

        return $count ? $this->take($count) : $this->clear();
    }
{@inheritdoc}