Bloodline::limit()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Staudenmeir\EloquentEagerLimitXLaravelAdjacencyList\Eloquent\Relations;
4
5
use Staudenmeir\EloquentEagerLimitXLaravelAdjacencyList\Eloquent\Relations\Traits\HasEagerLimit;
6
use Staudenmeir\LaravelAdjacencyList\Eloquent\Relations\Bloodline as Base;
7
8
class Bloodline extends Base
9
{
10
    use HasEagerLimit;
0 ignored issues
show
Bug introduced by
The trait Staudenmeir\EloquentEage...ns\Traits\HasEagerLimit requires the property $exists which is not provided by Staudenmeir\EloquentEage...ent\Relations\Bloodline.
Loading history...
11
12
    /**
13
     * Set the "limit" value of the query.
14
     *
15
     * @param int $value
16
     * @return $this
17
     */
18 12
    public function limit($value)
19
    {
20 12
        if ($this->parent->exists) {
21 4
            $this->query->limit($value);
22
        } else {
23 8
            $this->addGroupLimit($value);
24
        }
25
26 12
        return $this;
27
    }
28
}
29