public function set($key, $definition = [])
    {
        $this->_definitions[$key] = $this->formatDefinition($key, $definition);
        unset($this->_singletons[$key]);
        return $this;
    }
public function set($key, $definition = [])
    {
        $this->_definitions[$key] = $this->formatDefinition($key, $definition);
        unset($this->_singletons[$key]);
        return $this;
    }
public function set ( $ key , $ definition = [ ] ) { $ this -> _definitions [ $ key ] = $ this -> formatDefinition ( $ key , $ definition ) ; unset ( $ this -> _singletons [ $ key ] ) ; return $ this ; }
set a key-callback with this container.

For example,

```php
// register a class name as is. This can be skipped.
$container->set('namespace\SomeClass');

// register an interface
$container->set('mail\MailInterface', 'swiftmailer\Mailer');

// register an alias name. You can use $container->get('foo')
$container->set('foo', 'namespace\SomeClass');

// register a class with configuration.
$container->set('Wslim\Db\Db', [
'dsn' => 'mysql:host=127.0.0.1;database=demo',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
]);

// register a class with alias name with configuration
$container->set('db', [
'class' => 'Wslim\Db\Db',
'dsn' => 'mysql:host=127.0.0.1;database=demo',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
]);

// register a callable
$container->set('db', function ($container, $config) {
return new Wslim\Db\Db($config);
});
```

@param string $key   key or class name or interface name
@param mixed  $definition the definition associated with `$class`.

@return static the container itself
set a key - callback with this container .