Test Failed
Pull Request — master (#4)
by
unknown
03:29
created

Processor::processInsertGetId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace sonrac\Arango\Query\Processors;
3
use ArangoDBClient\Document;
4
use Illuminate\Database\Query\Builder;
5
use Illuminate\Database\Query\Processors\Processor as IlluminateProcessor;
6
/**
7
 * Created by PhpStorm.
8
 * User: admin
9
 * Date: 21.01.2018
10
 * Time: 15:19
11
 */
12
13
class Processor extends IlluminateProcessor
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
19
    {
20
        $result = $query->getConnection()->insert($sql, $values);
21
22
        $document = $result->getAll()[0];
0 ignored issues
show
Bug introduced by
The method getAll cannot be called on $result (of type boolean).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
23
        /**
24
         * @var Document $document
25
         */
26
27
        return $document->getKey();
28
    }
29
}