Skip to content

Commit

Permalink
refactor(any): rename Leevel\Kernel\IRuntime to Leevel\Kernel\IExcept…
Browse files Browse the repository at this point in the history
…ionRuntime
  • Loading branch information
doyouhaobaby committed Jan 19, 2020
1 parent e8730eb commit 632d739
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
* file that was distributed with this source code.
*/

namespace Common\App\Exception;
namespace Common\App;

use Exception;
use Leevel;
use Leevel\Http\Request;
use Leevel\Http\Response;
use Leevel\Kernel\Runtime as Runtimes;
use Leevel\Kernel\ExceptionRuntime as BaseExceptionRuntime;

/**
* 异常处理.
*/
class Runtime extends Runtimes
class ExceptionRuntime extends BaseExceptionRuntime
{
/**
* {@inheritdoc}
Expand All @@ -42,15 +42,15 @@ public function render(Request $request, Exception $e): Response
}

/**
* 获取 HTTP 状态的异常模板
* 获取 HTTP 状态的异常模板.
*/
public function getHttpExceptionView(Exception $e): string
{
return Leevel::commonPath('ui/exception/'.$e->getStatusCode().'.php');
}

/**
* 获取 HTTP 状态的默认异常模板
* 获取 HTTP 状态的默认异常模板.
*/
public function getDefaultHttpExceptionView(): string
{
Expand Down
6 changes: 3 additions & 3 deletions leevel
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ declare(strict_types=1);
* file that was distributed with this source code.
*/

use Common\App\Exception\Runtime;
use Common\App\ExceptionRuntime;
use Common\App\Kernel;
use Common\App\KernelConsole;
use Leevel\Di\Container;
use Leevel\Di\IContainer;
use Leevel\Kernel\App;
use Leevel\Kernel\IApp;
use Leevel\Kernel\IExceptionRuntime;
use Leevel\Kernel\IKernel;
use Leevel\Kernel\IKernelConsole;
use Leevel\Kernel\IRuntime;

/**
* ---------------------------------------------------------------
Expand All @@ -48,7 +48,7 @@ $container->alias('app', [IApp::class, App::class]);

$container->singleton(IKernel::class, Kernel::class);
$container->singleton(IKernelConsole::class, KernelConsole::class);
$container->singleton(IRuntime::class, Runtime::class);
$container->singleton(IExceptionRuntime::class, ExceptionRuntime::class);

/**
* ---------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

namespace Tests;

use Common\App\Exception\Runtime;
use Common\App\ExceptionRuntime;
use Common\App\Kernel;
use Common\App\KernelConsole;
use Leevel\Di\Container;
use Leevel\Di\IContainer;
use Leevel\Http\Request;
use Leevel\Kernel\App as KernelApp;
use Leevel\Kernel\IApp;
use Leevel\Kernel\IExceptionRuntime;
use Leevel\Kernel\IKernel;
use Leevel\Kernel\IKernelConsole;
use Leevel\Kernel\IRuntime;

/**
* 初始化应用.
Expand All @@ -46,7 +46,7 @@ protected function createApp(): KernelApp

$container->singleton(IKernel::class, Kernel::class);
$container->singleton(IKernelConsole::class, KernelConsole::class);
$container->singleton(IRuntime::class, Runtime::class);
$container->singleton(IExceptionRuntime::class, ExceptionRuntime::class);

$container->instance('request', Request::createFromGlobals());
$container->alias('request', [Request::class, Request::class]);
Expand Down
6 changes: 3 additions & 3 deletions www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
* file that was distributed with this source code.
*/

use Common\App\Exception\Runtime;
use Common\App\ExceptionRuntime;
use Common\App\Kernel;
use Leevel\Di\Container;
use Leevel\Di\IContainer;
use Leevel\Http\Request;
use Leevel\Kernel\App;
use Leevel\Kernel\IApp;
use Leevel\Kernel\IExceptionRuntime;
use Leevel\Kernel\IKernel;
use Leevel\Kernel\IRuntime;

/**
* ---------------------------------------------------------------
Expand All @@ -45,7 +45,7 @@
$container->alias('app', [IApp::class, App::class]);

$container->singleton(IKernel::class, Kernel::class);
$container->singleton(IRuntime::class, Runtime::class);
$container->singleton(IExceptionRuntime::class, ExceptionRuntime::class);

/**
* ---------------------------------------------------------------
Expand Down

0 comments on commit 632d739

Please sign in to comment.