1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-10 15:14:20 +02:00

feat(core): Flextype Solid Core - next round #458

This commit is contained in:
Awilum
2020-08-14 16:56:57 +03:00
parent bac3e40b66
commit 285094926c
2 changed files with 48 additions and 35 deletions

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
/**
* Flextype (https://flextype.org)
* Founded by Sergey Romanenko and maintained by Flextype Community.
*/
namespace Flextype\App\Foundation;
use Slim\App;
class Flextype extends App
{
/**
* Flextype version
*
* @var string
*/
const FLEXTYPE_VERSION = '0.9.0';
private $instance;
private $flextype;
public function __construct($flextype = [])
{
parent::__construct($flextype);
$this->instance = $this;
$this->container = $this->instance->getContainer();
}
public function container($key = null)
{
if ($key != null) {
return $this->container[$key];
}
return $this->container;
}
public function getInstance()
{
return $this->instance;
}
}

View File

@@ -11,7 +11,7 @@ namespace Flextype;
use Flextype\Component\Registry\Registry;
use Flextype\Component\Session\Session;
use Slim\App;
use Flextype\App\Foundation\Flextype;
use Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware;
use function date_default_timezone_set;
use function error_reporting;
@@ -36,40 +36,6 @@ $registry = new Registry();
*/
include_once ROOT_DIR . '/src/flextype/preflight.php';
class Flextype extends App
{
/**
* Flextype version
*
* @var string
*/
const FLEXTYPE_VERSION = '0.9.0';
public $instance;
public $flextype;
public function __construct($flextype = [])
{
parent::__construct($flextype);
$this->instance = $this;
$this->container = $this->instance->getContainer();
}
public function container($key = null)
{
if ($key != null) {
return $this->container[$key];
}
return $this->container;
}
public function getInstance()
{
return $this->instance;
}
}
/**
* Create new application
*/