Completed
Pull Request — master (#22)
by Sergey
15:20 queued 20s
created

ElasticsearchModel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A createInstance() 0 4 1
1
<?php
2
3
namespace Isswp101\Persimmon\Test\Models;
4
5
use Elasticsearch\Client;
6
use Isswp101\Persimmon\DAL\ElasticsearchDAL;
7
use Isswp101\Persimmon\ElasticsearchModel as Model;
8
use Isswp101\Persimmon\Test\Models\Events\DALEmitter;
9
10
class ElasticsearchModel extends Model
11
{
12
    public function __construct(array $attributes = [])
13
    {
14
        $dal = new ElasticsearchDAL($this, app(Client::class), app(DALEmitter::class));
15
16
        parent::__construct($dal, $attributes);
17
    }
18
19
    public static function createInstance()
20
    {
21
        return new static();
22
    }
23
}
24