Completed
Push — master ( 8af693...a60473 )
by Enrico
03:36
created

AbstractResourceController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getStore() 0 6 2
1
<?php
2
3
namespace Resourceful\Controller;
4
use Silex\Application;
5
6
7
class AbstractResourceController
8
{
9
    protected $schema;
10
11
    use \Resourceful\StoreHelpers\StoreHelpers;
12
13 17
    public function __construct($schema=null)
14
    {
15 17
        $this->schema = $schema;
16 17
    }
17
18 15
	protected function getStore(Application $app)
19
    {
20 15
    	$type = $this->schema?basename($this->schema):'schema';
21
		
22 15
		return $this->getStoreForType($type, $app);
23
    }
24
}
25