Similar to jQuery "each" method. Calls the callback with each
Node in this collection.

@param callable $callback
978602
public function each(callable $callback)
    {
        foreach ($this->collection as $key => $value) {
            $callback($value, $key);
        }
    }
132087
public function mapWithKeys(callable $callback): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($callback) {
            foreach ($data as $key => $value) {
                /** @var iterable $result */
                $result = $callback($value, $key);

                foreach ($result as $resultKey => $resultValue) {
                    yield $resultKey => $resultValue;
                }
            }
        });
    }
699329
public function some(callable $callback) {
		$match = false;
		foreach ($this->collection as $element) {
			$match = $match || $callback($element);
		}

		return $match;
	}
1211799
public function eachRole(array $roles, callable $callback)
    {
        $roles = array_flatten($roles);

        foreach ($roles as $role) {
            if ($role = $this->prepareRole($role)) {
                $callback($role);    
            }
        }
    }
659595
public function calls(callable ...$callbacks): self
    {
        foreach ($callbacks as $callback) {
            $this->callsWith($callback);
        }

        return $this;
    }
751931
public function each(callable $callback)
    {
        foreach ($this->items as $key => $item) {
            $result = $callback($item, $key);

            if (false === $result) {
                break;
            }

            if (!is_object($item)) {
                $this->items[$key] = $result;
            }
        }

        return $this;
    }
1281874
public function setCallback($callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Expected a callable. Got an uncallable '. gettype($callback));
        }

        $this->callback = $callback;

        return $this;
    }
463483
public function find(callable $callback) {
    $matches = [];
    foreach ($this->nodes as $node) {
      if ($node instanceof ParentNode) {
        $matches = array_merge($matches, $node->find($callback)->nodes);
      }
    }
    return new NodeCollection($matches);
  }
215061
public function filter(callable $callback) {
    $matches = [];
    foreach ($this->nodes as $index => $node) {
      if ($callback($node, $index)) {
        $matches[] = $node;
      }
    }
    return new NodeCollection($matches, FALSE);
  }
960681
public function getObjects(callable $callback = null)
    {
        foreach ($this->resourceManager->getCollectionsByStorage($this) as $collection) {
            yield $this->getObjectsByCollection($collection, $callback);
        }
    }
369517
public function loop(callable $callback, int $i = 0)
    {
        $bound = $callback;
        if ($callback instanceof Closure) {
            $bound = $callback->bindTo($this, get_class($this));
        }

        if (call_user_func($bound, $i) !== false) {
            $this->loop($callback, $i + 1);
        }

        return $this;
    }
1250514
public function callback(string $name, callable $callback): self
    {
        $this->data->callback($name, $callback);
        return $this;
    }
948019
public function every(callable $callback) {
		$match = true;
		foreach ($this->collection as $element) {
			$match = $match && $callback($element);
		}

		return $match;
	}
181784
public function resetCallBack(callable $callBack = null)
    {
        $this->callBack = null;
        $this->callBack = $callBack;
        return $this;
    }
1219251
public function map($callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Callback has to be a valid callable, '.gettype($callback).' given.');
        }

        for ($i = 0; $this->checkIfLineNumberIsValid($i, false); $i++) {
            $this->setCurrentLineNumber($i);
            call_user_func($callback, $this->getLine($i), $i, $this);
        }
    }
1032826
public function has(callable $callback) {
    $matches = [];
    foreach ($this->nodes as $node) {
      if ($node instanceof ParentNode && $node->has($callback)) {
        $matches[] = $node;
      }
    }
    return new NodeCollection($matches, FALSE);
  }
751426
public function is(callable $callback) {
    foreach ($this->nodes as $node) {
      if ($callback($node)) {
        return TRUE;
      }
    }
    return FALSE;
  }