Passed
Push — master ( c6150b...ef80b0 )
by Mihail
05:01
created

ActionDebugCookie   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A debugCookie() 0 5 1
1
<?php
2
3
namespace Apps\Controller\Admin\Main;
4
5
6
use Ffcms\Core\App;
7
use Ffcms\Core\Arch\View;
8
use Ffcms\Core\Network\Request;
9
use Ffcms\Core\Network\Response;
10
11
/**
12
 * Trait ActionDebugCookie
13
 * @package Apps\Controller\Admin\Main
14
 * @property Request $request
15
 * @property Response $response
16
 * @property View $view
17
 */
18
trait ActionDebugCookie
19
{
20
    /**
21
     * Set debug cookies for current user
22
     * @return void
23
     */
24
    public function debugCookie()
25
    {
26
        $cookieProperty = App::$Properties->get('debug');
27
        setcookie($cookieProperty['cookie']['key'], $cookieProperty['cookie']['value'], strtotime('+1 month'), '/', null, null, true);
28
        $this->response->redirect('/');
29
    }
30
}