The class App has 16 public methods. Consider refactoring App to keep number of public methods under 10.
class App
{
/**
* array instances
*
Function singleton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
public function singleton($name, $callable = null)
{
if (!isset($this->instances[$name]) && $callable) {
$obj = call_user_func($callable);
if (!is_object($obj)) {
Avoid using undefined variables such as '$concrete' which will lead to PHP notices.
throw new Exception("Target [$concrete] is not instantiable!");
The class App has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
class App
{
/**
* array instances
*
Missing class import via use statement (line '151', column '24').
$request = new \Request($request->get, $request->post, [], $request->cookie
Missing class import via use statement (line '111', column '29').
$debugbar = new \Group\Debug\DebugBar();
Missing class import via use statement (line '141', column '29').
$debugbar = new \Group\Debug\DebugBar();
The method singleton uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$this->instances[$name] = $obj;
}
The method singleton uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
if (isset($this->aops[$name])) {
$this->instances[$name] = new Bean($name, $obj);
} else {
$this->instances[$name] = $obj;
Avoid unused local variables such as '$concrete'.
throw new Exception("Target [$concrete] is not instantiable!");
Avoid unused local variables such as '$request'.
$request = $this->container->getRequest();
Space found before comma in function call
, $request->files, $request->server);
Inline control structures are not allowed
if ($val == $provider) unset($this->serviceProviders[$key]);
Inline control structures are not allowed
if(isset($this->instances[$name]))
Whitespace found at end of line
{
Expected 1 space after closing parenthesis; found 0
if (!(self::$instance instanceof self)){
Whitespace found at end of line
{
Whitespace found at end of line
{
Whitespace found at end of line
{
Expected 1 space after IF keyword; 0 found
if(isset($this->instances[$name]))
Whitespace found at end of line
}
Whitespace found at end of line
{
Whitespace found at end of line
{
There are no issues that match your filters.