Concrete5   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A disconnect() 0 4 1
A connect() 0 4 1
1
<?php
2
3
namespace Buttress\ConcreteClient;
4
5
use Buttress\ConcreteClient\Connection\Connection;
6
use Buttress\ConcreteClient\Adapter\Adapter;
7
8
class Concrete5 implements Client
9
{
10
    protected $adapter;
11
12 8
    public function __construct(Adapter $adapter)
13
    {
14 8
        $this->adapter = $adapter;
15 8
    }
16
17
    /**
18
     * Attempt to disconnect
19
     * (This isn't going to be fully supported for awhile)
20
     *
21
     * @param \Buttress\ConcreteClient\Connection\Connection $connection
22
     * @return bool
23
     */
24 6
    public function disconnect(Connection $connection)
25
    {
26 6
        return $connection->disconnect();
27
    }
28
29
    /**
30
     * Get a connection to a concrete5 site
31
     * @param string $path The path to the site to connect to
32
     * @return Connection
33
     */
34 4
    public function connect($path)
35
    {
36 4
        return $this->adapter->attach($path);
37
    }
38
}
39