public function set(string $abstract, $concrete, $singleton = false) {
        if ($this->has($abstract)) {
            throw new ContainerException(
                sprintf('An entry with the id "%s" already exists.', $abstract)
            );
        }

        $this->bindings[$abstract] = new ContainerEntry($abstract, $concrete, $singleton);
        return true;
    }
public function set(string $abstract, $concrete, $singleton = false) {
        if ($this->has($abstract)) {
            throw new ContainerException(
                sprintf('An entry with the id "%s" already exists.', $abstract)
            );
        }

        $this->bindings[$abstract] = new ContainerEntry($abstract, $concrete, $singleton);
        return true;
    }
public function set ( string $ abstract , $ concrete , $ singleton = false ) { if ( $ this -> has ( $ abstract ) ) { throw new ContainerException ( sprintf ( 'An entry with the id "%s" already exists.' , $ abstract ) ) ; } $ this -> bindings [ $ abstract ] = new ContainerEntry ( $ abstract , $ concrete , $ singleton ) ; return true ; }
Bind a abstract to a concrete.
If the concrete is a object and not a string, it will be stored as it is.

@param string $abstract
@param object|string $concrete
@param bool $singleton If the created object is intended to be treated as a single instance on creation.

@return bool
@throws ContainerException
Bind a abstract to a concrete . If the concrete is a object and not a string it will be stored as it is .