Test Failed
Push — master ( b61af3...7b4275 )
by Ricardo
09:41
created

AbstractEntity   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A persist() 0 3 1
A toArray() 0 3 1
A jsonSerialize() 0 3 1
1
<?php
2
3
namespace Translation\Entities;
4
5
use Illuminate\Support\Collection;
6
use Illuminate\Contracts\Support\Arrayable;
7
use JsonSerializable;
8
9
/**
10
 * Class AbstractEntity.
11
 *
12
 * @package Core\Entities
13
 */
14
abstract class AbstractEntity implements Arrayable, JsonSerializable
15
{
16
    /**
17
     * @inheritdoc
18
     */
19
    public function toArray(): array
20
    {
21
        return [];
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function jsonSerialize(): array
28
    {
29
        return $this->toArray();
30
    }
31
32
    /**
33
     * persist
34
     *
35
     * @return bool
36
     */
37
    private function persist()
0 ignored issues
show
Unused Code introduced by
The method persist() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
38
    {
39
        $this->model::create($this->toArray());
40
    }
41
42
}
43