Completed
Push — extensions-support ( 7b99bd...ad8442 )
by Guido
03:55
created

AbstractLogEntryMapping::mapFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace LaravelDoctrine\Fluent\Extensions\Gedmo\Mappings\Loggable;
4
5
use Gedmo\Loggable\Entity\MappedSuperclass\AbstractLogEntry;
6
use LaravelDoctrine\Fluent\Fluent;
7
use LaravelDoctrine\Fluent\MappedSuperClassMapping;
8
9 View Code Duplication
class AbstractLogEntryMapping extends MappedSuperClassMapping
0 ignored issues
show
Duplication introduced by
This class 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...
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function mapFor()
15
    {
16
        return AbstractLogEntry::class;
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function map(Fluent $builder)
23
    {
24
        $builder->increments('id');
25
        $builder->string('action')->length(8);
26
        $builder->dateTime('loggedAt')->name('logged_at');
27
        $builder->string('objectId')->name('object_id')->length(64)->nullable();
28
        $builder->string('objectClass')->name('object_class');
29
        $builder->integer('version');
30
        $builder->array('data')->nullable();
31
        $builder->string('username')->nullable();
32
    }
33
}
34