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

ActionException::getNewAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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