PheanstalkConfiguration   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 15
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 1
A getPheanstalk() 0 7 3
1
<?php
2
3
namespace Equip\BeanstalkdConsumer\Configuration;
4
5
use Aura\Cli\Context;
6
use Auryn\Injector;
7
use Pheanstalk\Pheanstalk;
8
use Equip\Configuration\ConfigurationInterface;
9
10
class PheanstalkConfiguration implements ConfigurationInterface
11
{
12 1
    public function apply(Injector $injector)
13
    {
14 1
        $injector->delegate(Pheanstalk::class, [$this, 'getPheanstalk']);
15 1
    }
16
17 1
    public function getPheanstalk(Context $context)
18
    {
19 1
        $env = $context->env;
20 1
        $host = $env->get('BEANSTALKD_HOST') ?: '127.0.0.1';
21 1
        $port = $env->get('BEANSTALKD_PORT') ?: 11300;
22 1
        return new Pheanstalk($host, $port);
23
    }
24
}
25