for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace nebula\application;
use Exception;
use nebula\NebulaApplication;
use nebula\application\Resource;
use nebula\component\loader\Path;
use nebula\application\config\Config;
use nebula\component\request\Request;
/**
* 应用程序加载器
*
* 负责加载
*/
class Application
{
* 应用
* @var NebulaApplication
protected $nebula;
* 资源管理
* @var Resource
protected $resource;
public function setNebula(NebulaApplication $application)
$this->nebula = $application;
}
* Get 资源管理
* @return Resource
public function getResource()
return $this->resource;
* Set 资源管理
* @param Resource $resource 资源管理
* @return self
public function setResource(Resource $resource)
$this->resource = $resource;
return $this;
* Get 应用
* @return NebulaApplication
public function getNebula()
return $this->nebula;
* 初始化
* @return void
public function initiation()
$this->initResource();
* 处理请求
* @param Request $request
* @return boolean
public function onRequest(Request $request): bool {
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onRequest(/** @scrutinizer ignore-unused */ Request $request): bool {
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return false;
* 处理异常
* @param Exception $exception
public function onException(Exception $exception): bool {
$exception
public function onException(/** @scrutinizer ignore-unused */ Exception $exception): bool {
protected function initResource()
$resource = new Resource;
foreach ($this->getNebula()->getConfig()->get('app.resource') as $path) {
if (Path::isRelativePath($path)) {
$path = Resource::getPathByRelativedPath($path, constant('NEBULA_APP'));
$resource->addResourcePath($path);
$this->setResource($resource);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.