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

AbstractResourceController::getStore()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 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