Processor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A processInsertGetId() 0 9 1
1
<?php
2
3
namespace sonrac\Arango\Query\Processors;
4
5
use ArangoDBClient\Document;
6
use Illuminate\Database\Query\Builder;
7
use Illuminate\Database\Query\Processors\Processor as IlluminateProcessor;
8
9
class Processor extends IlluminateProcessor
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
15
    {
16
        $result = $query->getConnection()->insert($sql, $values);
17
18
        $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...
19
        /* @var Document $document */
20
21
        return $document->getKey();
22
    }
23
}
24