TestCookieStore   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A canWrite() 0 8 2
1
<?php
2
3
namespace SilverStripe\HybridSessions\Tests\Store;
4
5
use SilverStripe\HybridSessions\Store\CookieStore;
6
use SilverStripe\Dev\TestOnly;
7
8
class TestCookieStore extends CookieStore implements TestOnly
9
{
10
    /**
11
     * Override value of 'headers_sent' but only if running tests.
12
     *
13
     * Set to true or false, or null to not override
14
     *
15
     * @var string
16
     */
17
    public static $override_headers_sent = null;
18
19
    protected function canWrite()
20
    {
21
        if (self::$override_headers_sent !== null) {
22
            return !self::$override_headers_sent;
23
        }
24
25
        parent::canWrite();
26
    }
27
}
28