Register an ACL Container instance with Closure.

@param  string  $name
@param  callable|null  $callback

@return \Orchestra\Contracts\Authorization\Authorization
500217
public function register($name, ?callable $callback = null): AuthorizationContract
    {
        if (\is_callable($name)) {
            $callback = $name;
            $name = null;
        }

        $instance = $this->make($name);

        $callback($instance);

        return $instance;
    }
1184511
public function addModifier($name, $callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Invalid argument type. Callbacks must be callable.');
        }
        $this->modifiers[$name] = $callback;
        return $this;
    }
300725
public function addStep($name, $callback)
    {
        $step = $this->factory([
            'Step',
            'wizard'  => $this,
            'template'=> clone $this->stepTemplate,
            'sequence'=> count($this->steps),
        ], $name);

        // add tabs menu item
        $this->steps[] = $this->add($step, 'Step');

        if (!$this->stepCallback->triggered()) {
            $_GET[$this->stepCallback->urlTrigger] = 0;
        }

        if ($step->sequence == $this->currentStep) {
            $step->addClass('active');

            $this->stepCallback->set($callback, [$this]);
        } elseif ($step->sequence < $this->currentStep) {
            $step->addClass('completed');
        }

        if ($step->icon == null) {
            $step->icon = $this->defaultIcon;
        }

        return $step;
    }
143375
protected function buildBasic($name, Closure $callback = null)
    {
        if ($name instanceof Closure) {
            $callback = $name;
            $name     = null;
        }
        //!empty($name) && $this->legend($name);

        call_user_func($callback, $this);
    }
905850
public function addFilter($callback, $name = null)
    {
        $tuple = $this->createFilterTuple(func_get_args());

        $this->filters[] = $tuple;

        $this->handleChangedParameters();

        return $this;
    }
95916
public function javascript($name, Closure $callback = null)
    {
        return $this->add($name, function($asset) use ($callback)
        {
            $asset->setGroup('javascripts');

            is_callable($callback) and call_user_func($callback, $asset);
        });
    }
250555
protected function setArray($name, callable $callback = null)
    {
        return $this->field(Type::TARRAY, $name, $callback);
    }
916546
public static function libRepo($name, $callback = false) {
		
		if ($callback !== false and is_callable($callback)) {
			static::$libs_callbacks[$name] = $callback;
		} else {
			return static::$libs_callbacks[$name];
		}
		
	}
415629
public function add(string $name, callable $callback): \IvoPetkov\BearFrameworkAddons\ServerRequests
    {
        $this->callbacks[$name] = $callback;
        return $this;
    }
264525
public function singleton(string $name, callable $callback = null)
    {
        static $instance = [];

        // if closure callback given we will create a singleton instance of class
        // and return it to user
        if ($callback instanceof Closure) {
            if (!isset($instance[$name])) {
                $instance[$name] = $callback($this);
            }

            return $this->stack[$name] = $instance[$name];
        }

        /*
         | If callback is not instance of closure then we will simply
         | create a singleton instance and return it
         */
        if (!isset($instance[$name])) {
            $instance[$name] = new $name();
        }

        return $instance[$name];
    }
962586
public function extend($name, Closure $callback)
    {
        $this->parsers[Str::camel($name)] = Str::title($name);

        return parent::extend($name, $callback);
    }
279715
public function addListener($name, callable $callback) {
        if(!array_key_exists($name, $this->registered_events)) {
            $this->registered_events[$name] = [];
        }

        $this->registered_events[$name][] = $callback;
    }
63335
public static function register( $name, $callback = null, $sanitizer = null ) {
		unset( static::$resolved[ $name ] );

		if ( $callback instanceof Field_Type ) {
			$instance = $callback;

			list( $callback, $sanitizer ) = [
				[ $instance, 'display' ],
				[ $instance, 'sanitization' ],
			];

			static::$instances[ $name ] = $instance;
		}

		static::$bindings[ $name ] = compact( 'callback', 'sanitizer' );
	}
374658
public function onRegister($name, Closure $callback)
    {
        $priority                  = $this->getPluginPriority($name);
        $this->registerCallbacks[] = compact('name', 'priority', 'callback');
    }
89132
public function registerFunction(string $name, callable $callback): self
    {
        if (\preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name) !== 1) {
            throw new \LogicException('Not a valid function name.');
        }

        $this->functions[$name] = $callback;

        return $this;
    }
875409
public function macro($name, Closure $callback){
        $this->macros[$name] = Closure::bind($callback, $this, get_class());

        return $this;
    }
724837
public function registerHelper(string $name, callable $callback): self
    {
        $this->helpers->add($name, $callback);
        return $this;
    }