Application::createApplication()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 13
ccs 8
cts 8
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpCfdi\RfcLinc\Application\Web;
6
7
use PhpCfdi\RfcLinc\Application\SetUpContainerTrait;
8
use PhpCfdi\RfcLinc\Application\Web\Controllers\ListedRfcController;
9
use Silex\Application as SilexApp;
10
11
class Application extends SilexApp
12
{
13
    use SetUpContainerTrait;
14
15 2
    public static function createApplication(): self
16
    {
17
        // create
18 2
        $app = new static();
19 2
        static::setUpContainer($app);
20
21
        // register the only route
22 2
        $app->get('lrfc/{id}', function (SilexApp $app, string $id) {
23 2
            $controller = new ListedRfcController($app['gateways']);
24 2
            return $controller->get($id);
25 2
        });
26
27 2
        return $app;
28
    }
29
}
30