Ajoute un ou plusieurs inputs avant un élément existant.

@param string   $key      Clé unique.
@param callable $callback Fonction de création du sous-formulaire.

@throws \Exception L'élément n'a pas été trouvé.
@return $this
165802
public function addBefore($key, callable $callback)
    {
        if ($this->addItem($key, $callback)) {
            return $this;
        }

        throw new \Exception(htmlspecialchars("The item $key was not found."));
    }
141205
public function each(callable $callback)
    {
        foreach ($this->nodes as $index => $node) {
            $return_value = \call_user_func($callback, $node, $index);

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

        return $this;
    }
1184438
public function setCallback($callback)
    {
        if($callback instanceof Closure)
        {
            $this->callback = $callback;
        }
        elseif(is_callable($callback))
        {
            $this->callback = function($chunk) use($callback)
            {
                return call_user_func_array($callback, [$chunk]);
            };
        }
        else
        {
            throw new Exception('Invalid callback');
        }

        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;
    }
215649
protected function bindOriginalRow(Closure $callback, $key)
    {
        $originalRow = static::$originalGridData[$key];

        return $callback->bindTo(static::$model->newFromBuilder($originalRow));
    }
22492
public function setEditableValueCallback($callback)
    {
        $this->isEditable() ?: $this->setEditable();
        $this->editableValueCallback = $callback;

        return $this;
    }
747204
public function each(callable $callback): ArrayCollection
    {
        foreach ($this->items as $key => $value) {
            $callback($value, $key);
        }

        return $this;
    }
264721
public function withKey($key, $value, callable $callable)
    {
        $initialValue = $this->get($key);
        try {
            $this->set($key, $value);

            return $callable();
        } finally {
            $this->set($key, $initialValue);
        }
    }
768352
public function reanimateCallback($callback)
    {
        $key = $this->getCallbackKey($callback);

        self::$_baseRealCallbacks[$key] = $callback;

        return $this;
    }
627658
public function bind(string $name, callable $callback): self
    {
        $this->bindings[$name] = $callback;
        return $this;
    }
264540
protected function sear($key, callable $callback)
    {
        if (is_null($value = $this->cache->get($key))) {
            $this->cache->forever($key, $value = $callback());
        }

        return $value;
    }
555849
public function map(callable $callback) {
		$that = clone $this;
		foreach ($that->getIterator() as $index => $item) {
			$that->offsetSet($index, $callback($item));
		}
		return $that;
	}
900181
public function transform(callable $callback): self
    {
        $index = 0;
        foreach ($this->items as $key => $value) {
            $this->set($key, $callback($value, $key, $index++));
        }

        return $this;
    }
633015
public function capture_append( $key, $callback ) 
	{
		return $this->set( $key, $this->get( $key, '' ).CCStr::capture( $callback, $this ) );
	}
529439
public function make($key, callable  $callable)
    {
        $menu = new Menu($callable);
        $menu->key($key);

        $this->collection->put($key, $menu);

        return $this;
    }
1235819
public function each($callback)  
    {
        Eden_Array_Argument::i()->test(1, 'callable');

        foreach ($this->data as $key => $value) {
            call_user_func($callback, $key, $value);
        }

        return $this;
    }
384504
public function rememberForever($key, Closure $callback)
    {
        if (is_array($key)) {
            return $this->rememberManyForever($key, $callback);
        }

        return parent::rememberForever($key, $callback);
    }