Passed
Push — main ( 31aa9e...537bf7 )
by Jonas
11:44
created

MySqlGrammar::compileFirstPathSegment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Staudenmeir\EloquentEagerLimitXLaravelAdjacencyList\Query\Grammars;
4
5
use Illuminate\Database\Query\Grammars\MySqlGrammar as Base;
6
7
class MySqlGrammar extends Base implements EagerLimitGrammar
8
{
9
    /**
10
     * Compile an initial path. TODO
11
     *
12
     * @param string $column
13
     * @return string
14
     */
15
    public function compileFirstPathSegment($column)
16
    {
17
        $column = $this->wrap($column);
18
19
        return "substring_index($column, ?, 1)";
20
    }
21
}
22