public function loop($data, Closure $callback)
    {
        TypeChecker::isIterable($data);

        foreach ($data as $key => $value) {
            $builder = new static();
            $callback($builder, $value, $key);
            $this->addNotification($builder->getNotification());
        }

        return $this;
    }
public function loop($data, Closure $callback)
    {
        TypeChecker::isIterable($data);

        foreach ($data as $key => $value) {
            $builder = new static();
            $callback($builder, $value, $key);
            $this->addNotification($builder->getNotification());
        }

        return $this;
    }
public function loop ( $ data , Closure $ callback ) { TypeChecker :: isIterable ( $ data ) ; foreach ( $ data as $ key => $ value ) { $ builder = new static ( ) ; $ callback ( $ builder , $ value , $ key ) ; $ this -> addNotification ( $ builder -> getNotification ( ) ) ; } return $ this ; }
Loop over data and call the callback with a new Builder instance and the key and value of the iterated data.

@param array|\Traversable $data
@param Closure $callback
@return $this
@throws UnvalidNotificationException
Loop over data and call the callback with a new Builder instance and the key and value of the iterated data .