Completed
Push — master ( 07c904...689f05 )
by Helmut
03:40
created

Memory::onRender()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
1
<?php 
2
3
namespace Helmut\Forms\Plugins\Memory;
4
5
use Helmut\Forms\Plugin;
6
7
class Memory extends Plugin {
8
9
    protected $token;
10
11
    public function setToken($token)
12
    {
13
        $this->token = $token;
14
15
        return $this;
16
    }
17
18
    public function onRender($form)
0 ignored issues
show
Unused Code introduced by
The parameter $form is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        if (is_null($this->token)) {
21
            throw new \Exception('Memory plugin requires token to be set');
22
        }
23
    }
24
25
    public function onSubmitted($form)
0 ignored issues
show
Unused Code introduced by
The parameter $form is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        // Save the data
28
    }
29
30
    public function onCompleted($form)
0 ignored issues
show
Unused Code introduced by
The parameter $form is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        // Clear the data
33
    }
34
35
36
}