Skip to content

Commit

Permalink
Bind default accessors in Container
Browse files Browse the repository at this point in the history
  • Loading branch information
kokororin committed Sep 23, 2017
1 parent 859d665 commit 4f628a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/App.php
Expand Up @@ -66,17 +66,6 @@ public function __construct($config = [])
if (!empty($config)) {
$this->config = $config;
}

Container::getInstance()->bind([
'cache' => \Kotori\Core\Cache::class,
'config' => \Kotori\Core\Config::class,
'controller' => \Kotori\Core\Controller::class,
'request' => \Kotori\Http\Request::class,
'response' => \Kotori\Http\Response::class,
'route' => \Kotori\Http\Route::class,
'trace' => \Kotori\Debug\Trace::class,
'model/provider' => \Kotori\Core\Model\Provider::class,
]);
}

/**
Expand Down
21 changes: 21 additions & 0 deletions src/Core/Container.php
Expand Up @@ -26,6 +26,27 @@ class Container
*/
protected static $instance;

/**
* Class constructor
*
* Bind default accessors
*
* @return void
*/
public function __construct()
{
$this->bind([
'cache' => \Kotori\Core\Cache::class,
'config' => \Kotori\Core\Config::class,
'controller' => \Kotori\Core\Controller::class,
'request' => \Kotori\Http\Request::class,
'response' => \Kotori\Http\Response::class,
'route' => \Kotori\Http\Route::class,
'trace' => \Kotori\Debug\Trace::class,
'model/provider' => \Kotori\Core\Model\Provider::class,
]);
}

/**
* Get singleton
*
Expand Down

0 comments on commit 4f628a3

Please sign in to comment.