Completed
Push — master ( a505a0...5d1dca )
by Fèvre
20s
created

UsersTwoFactorAuthTable::initialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 14
loc 14
rs 9.4285
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
namespace App\Model\Table;
3
4
use Cake\Database\Schema\Table as Schema;
5
use Cake\ORM\Table;
6
7
class UsersTwoFactorAuthTable extends Table
8
{
9
    /**
10
     * Initialize schema method
11
     *
12
     * @param \Cake\Database\Schema\Table $schema The schema of the Table.
13
     *
14
     * @return \Cake\Database\Schema\Table
15
     */
16
    protected function _initializeSchema(Schema $schema)
17
    {
18
        $schema->columnType('secret', 'encryptedsecurity');
19
        $schema->columnType('username', 'encryptedsecurity');
20
        $schema->columnType('session', 'encryptedsecurity');
21
        $schema->columnType('recovery_code', 'encryptedsecurity');
22
23
        return $schema;
24
    }
25
26
    /**
27
     * Initialize method
28
     *
29
     * @param array $config The configuration for the Table.
30
     *
31
     * @return void
32
     */
33 View Code Duplication
    public function initialize(array $config)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        parent::initialize($config);
36
37
        $this->table('users_two_factor_auth');
38
        $this->displayField('id');
39
        $this->primaryKey('id');
40
41
        $this->addBehavior('Timestamp');
42
43
        $this->belongsTo('Users', [
44
            'foreignKey' => 'user_id'
45
        ]);
46
    }
47
}
48