ChangeUrl   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace DM\AjaxCom\Responder;
4
5
class ChangeUrl extends AbstractResponder
6
{
7
    const OBJECT_IDENTIFIER = 'changeurl';
8
9
    const OPTION_URL = 'url';
10
    const OPTION_METHOD = 'method';
11
    const OPTION_WAIT = 'wait';
12
13
    const PUSH = 'push';
14
    const REPLACE = 'replace';
15
    const REDIRECT = 'redirect';
16
17
    /**
18
     * Constructor
19
     *
20
     * @param string $url The new URL
21
     * @param string $method push|replace|redirect
22
     * @param integer $wait How long to wait until changing URL
23
     */
24
    public function __construct($url, $method, $wait = 0)
25
    {
26
        $this->registerOption(self::OPTION_URL);
27
        $this->registerOption(self::OPTION_METHOD);
28
        $this->registerOption(self::OPTION_WAIT);
29
30
        $this->setOption(self::OPTION_URL, $url);
31
        $this->setOption(self::OPTION_METHOD, $method);
32
        $this->setOption(self::OPTION_WAIT, $wait);
33
    }
34
}
35