HasRelationships   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A withRelationships() 0 5 1
1
<?php
2
3
namespace Sfneal\Queries\Traits;
4
5
// todo: add tests with relationship
6
7
trait HasRelationships
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $relationships = [];
13
14
    /**
15
     * Dynamically eager load model relationships.
16
     *
17
     * @param  array  $relationships
18
     * @return $this
19
     */
20
    public function withRelationships(array $relationships = []): self
21
    {
22
        $this->relationships = $relationships;
23
24
        return $this;
25
    }
26
}
27