Completed
Push — actionrefactor ( 6e4bf0 )
by Andreas
04:36
created

ActionException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getNewAction() 0 3 1
1
<?php
2
3
namespace dokuwiki\Action\Exception;
4
5
/**
6
 * Class ActionException
7
 *
8
 * This exception and its subclasses signal that the current action should be
9
 * aborted and a different action should be used instead. The new action can
10
 * be given as parameter in the constructor. Defaults to 'show'
11
 *
12
 * The message will NOT be shown to the enduser
13
 *
14
 * @package dokuwiki\Action\Exception
15
 */
16
class ActionException extends \Exception {
17
18
    protected $newaction;
19
20
    /**
21
     * ActionException constructor.
22
     *
23
     * @param string $newaction the action that should be used next
24
     * @param string $message optional message, will not be shown except for some dub classes
25
     */
26
    public function __construct($newaction = 'show', $message = '') {
27
        parent::__construct($message);
28
        $this->newaction = $newaction;
29
    }
30
31
    /**
32
     * Returns the action to use next
33
     *
34
     * @return string
35
     */
36
    public function getNewAction() {
37
        return $this->newaction;
38
    }
39
}
40