Test Failed
Pull Request — master (#4)
by
unknown
11:18
created

Processor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A processInsertGetId() 0 11 1
1
<?php
2
namespace sonrac\Arango\Query\Processors;
3
use ArangoDBClient\Cursor;
4
use ArangoDBClient\Document;
5
use Illuminate\Database\Query\Builder;
6
use \Illuminate\Database\Query\Processors\Processor as IlluminateProcessor;
7
/**
8
 * Created by PhpStorm.
9
 * User: admin
10
 * Date: 21.01.2018
11
 * Time: 15:19
12
 */
13
14
class Processor extends IlluminateProcessor
15
{
16
    /**
17
     * @inheritdoc
18
     */
19
    function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
20
    {
21
        $result = $query->getConnection()->insert($sql, $values);
22
23
        $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...
24
        /**
25
         * @var Document $document
26
         */
27
28
        return $document->getKey();
29
    }
30
}