Register a binding with the registry

@param string $alias The alias used for registering the binding
@param \Closure|object|string|null $binding The binding requested to register
@param boolean $shared The type of the binding: shared (singleton) or not
9904
public function register($alias, $binding, $shared = false)
    {
        $this->registry[$alias] = new Resolver(new Builder($binding), $shared);
    }
496780
protected function registerBindings()
    {
        $binding = config('binding')?: [];

        foreach($binding as $contract => $implementation) {
            $this->bind($contract, $implementation);
        }
    }
1297264
public static void register(String type, String local, String alias) {
        instance.get(type).register(local, alias);
    }
498373
public function bind($abstract, $concrete = null, $shared = false)
    {
        $this->app->bind($abstract, $concrete, $shared);
    }
376048
public function bind($abstract, $concrete = null, $shared = false)
    {
        $this->dropStaleInstances($abstract);

        // If no concrete type was given, we will simply set the concrete type to the
        // abstract type. After that, the concrete type to be registered as shared
        // without being forced to state their classes in both of the parameters.
        if (is_null($concrete)) {
            $concrete = $abstract;
        }

        // If the factory is not a Closure, it means it is just a class name which is
        // bound into this container to the abstract type and we will just wrap it
        // up inside its own Closure to give us more convenience when extending.
        if (! $concrete instanceof Closure) {
            $concrete = $this->getClosure($abstract, $concrete);
        }

        $this->bindings[$abstract] = compact('concrete', 'shared');

        // If the abstract type was already resolved in this container we'll fire the
        // rebound listener so that any objects which have already gotten resolved
        // can have their copy of the object updated via the listener callbacks.
        if ($this->resolved($abstract)) {
            $this->rebound($abstract);
        }
    }
495335
protected function registerBindings(array $bindings)
	{
		foreach($bindings as $binding)
		{
			$this->bindings[(string)$binding] = $binding;
				
			foreach($binding->getMarkers() as $marker)
			{
				$marker = get_class($marker);
		
				if(empty($this->markers[$marker]))
				{
					$this->markers[$marker] = new \SplObjectStorage();
				}
		
				$this->markers[$marker]->attach($binding);
			}
		}
	}
278823
protected function setDefinition($id, $definition, $shared = false)
    {
        $this->definitions[$id] = $definition;
        if (true === $shared) {
            $this->shared[$id] = $id;
        }
    }
829839
public function add($name,$bind,$method='GET',$domain='',$suffix='')
    {
        $prefix=isset($this->group['prefix']) ? $this->group['prefix'] : '';
        $suffix=isset($this->group['suffix']) ? $this->group['suffix'] : '';
        $namespace=isset($this->group['namespace']) ? $this->group['namespace'].'/' : '';
        if(is_array($bind)){
            $as=$bind['as'];
            $bind=$bind['uses'];
        }else{
            $as='';
        }
        $this->index=Lists::set([
            'name'=>$as,
            'pattern'=>$prefix.$name.$suffix,
            'bind'=>$namespace.$bind,
            'method'=>$method,
            'domain'=>($domain=='' ? (isset($this->group['domain']) ? $this->group['domain'] : '') : $domain),
        ]);
        return $this;
    }
157231
public function registerAlias($alias, $file, $extension = null)
    {
        if ($extension === null) {
            $extension = File::extension($file);
        }

        $extension = strtolower($extension);

        if (!isset($this->aliases[$extension])) {
            $this->aliases[$extension] = [];
        }

        $this->aliases[$extension][$alias] = $file;

        return $this;
    }
494201
public function set($name, $definition, $shared = false)
    {
        /** @var $widget \Phalcon\DI\Service */
        $widget = $this->getDI()->get('\Phalcon\DI\Service', [$name, $definition, $shared]);
        $this->_widgets[$name] = $widget;

        return $this;
    }
390426
public function acceptsBinding($binding)
    {
        return $binding instanceof $this->acceptedBindingClass
            || $binding === $this->acceptedBindingClass
            || is_subclass_of($binding, $this->acceptedBindingClass);
    }
508721
public function isRegistered($alias)
    {
        $alias = $this->inflectClassName($alias);

        $isRegistered = parent::isRegistered($alias);
        if ( !$isRegistered ) {
            if ( array_key_exists($alias, $this->aliases) ) {
                return TRUE;
            }
        }

        return $isRegistered;
    }
781555
public function register($alias, \Closure $closure)
    {
        if (!is_string($alias))
            throw new Exception('Application::register() requires a string as the first parameter.');
        
        $this->registered[$alias] = $closure;
        
        return true;
    }
863555
public function bindIf($abstract, $concrete = null, $shared = false)
    {
        if (! $this->bound($abstract)) {
            $this->bind($abstract, $concrete, $shared);
        }
    }
646822
public function register(Container $container, $alias = null)
    {
        $container->set('Repository', [$this, 'createRepositoryFactory'], true, true);

        if (!empty($alias)) {
            $container->alias($alias, 'Repository');
        }
    }
207700
public function setBind($bind, $merge = true)
    {
        $this->_bind = $merge ? array_merge($this->_bind, $bind) : $bind;

        return $this;
    }
755630
public function createClassBinding( $binding )
	{
		return function ( $value, $route ) use ( $binding )
		{
			// If the binding has an @ sign, we will assume it's being used to delimit
			// the class name from the bind method name. This allows for bindings
			// to run multiple bind methods in a single class for convenience.
			$segments = explode( '@', $binding );

			$method = count( $segments ) == 2 ? $segments[1] : 'bind';

			$callable = [BindingBuilder::resolveBinding( $segments[0] ), $method];

			return call_user_func( $callable, $value, $route );
		};
	}