Swoole::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Bootstrap;
6
7
use function Canvas\Core\appPath;
8
use Phalcon\Di\FactoryDefault;
0 ignored issues
show
Bug introduced by
The type Phalcon\Di\FactoryDefault was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Phalcon\Mvc\Micro;
0 ignored issues
show
Bug introduced by
The type Phalcon\Mvc\Micro was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * Class Api.
13
 *
14
 * @package Canvas\Bootstrap
15
 *
16
 * @property Micro $application
17
 */
18
class Swoole extends AbstractBootstrap
19
{
20
    /**
21
     * Run the application.
22
     *
23
     * @return mixed
24
     */
25
    public function run()
26
    {
27
        return $this->application->handle(
28
            $this->container->getRequest()->getServer('request_uri', null, '/')
29
        );
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35
    public function setup()
36
    {
37
        //set the default DI
38
        $this->container = new FactoryDefault();
39
        //set all the services
40
        $this->providers = require appPath('api/config/providers.php');
41
42
        //run my parents setup
43
        parent::setup();
44
    }
45
}
46