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

Memory   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setToken() 0 6 1
A onRender() 0 6 2
A onSubmitted() 0 4 1
A onCompleted() 0 4 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
}