Passed
Push — master ( a8ec29...5f73fa )
by Chauncey
08:25
created

AbstractCacheAction::setDependencies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Charcoal\Admin\Action\System;
4
5
// From PSR-6
6
use Psr\Cache\CacheItemPoolInterface;
7
8
// From PSR-7
9
use Psr\Http\Message\RequestInterface;
10
use Psr\Http\Message\ResponseInterface;
11
12
// From Pimple
13
use Pimple\Container;
14
15
// From 'charcoal-cache'
16
use Charcoal\Cache\CachePoolAwareTrait;
17
18
// From 'charcoal-admin'
19
use Charcoal\Admin\AdminAction;
20
21
/**
22
 * Base Cache Action
23
 */
24
abstract class AbstractCacheAction extends AdminAction
25
{
26
    use CachePoolAwareTrait;
27
28
    /**
29
     * @return array
30
     */
31
    public function results()
32
    {
33
        return [
34
            'success'   => $this->success(),
35
            'feedbacks' => $this->feedbacks(),
36
        ];
37
    }
38
39
    /**
40
     * Set dependencies from the service locator.
41
     *
42
     * @param  Container $container A service locator.
43
     * @return void
44
     */
45
    protected function setDependencies(Container $container)
46
    {
47
        parent::setDependencies($container);
48
49
        $this->setCachePool($container['cache']);
50
    }
51
}
52