MiddlewareServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 1
1
<?php
2
declare(strict_types=1);
3
4
namespace App\Providers;
5
6
use App\Middleware\BasicAuth;
7
use App\Middleware\BenchMark;
8
use Illuminate\Container\Container;
9
use Psr\Log\LoggerInterface;
10
11
class MiddlewareServiceProvider implements ServiceProviderInterface
12
{
13 1
    public function register(Container $container)
14
    {
15
        $container->singleton(BenchMark::class, function (Container $container) {
16 1
            return new BenchMark($container->get(LoggerInterface::class));
17 1
        });
18
19
        $container->singleton(BasicAuth::class, function () {
20 1
            return new BasicAuth(
21 1
                getenv('BASIC_AUTH_USER'),
22 1
                getenv('BASIC_AUTH_PASSWORD'),
23 1
                getenv('BASIC_AUTH_REALM')
24
            );
25 1
        });
26 1
    }
27
}
28