Completed
Push — master ( 875e31...5dcd9d )
by Christopher
01:20
created

Connection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A RegisterTableToProvide() 0 3 1
A selectOne() 0 5 1
A select() 0 5 1
1
<?php
2
namespace AlgoWeb\ModelViews\Database;
3
4
use Illuminate\Database\Connection as BaseConnection;
5
use Illuminate\Database\Eloquent\Model;
6
class Connection extends BaseConnection
7
{
8
    protected static $classes;
9
10
    public static function RegisterTableToProvide(Model $ModelOfTable){
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
Coding Style introduced by
function RegisterTableToProvide() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
$ModelOfTable does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Unused Code introduced by
The parameter $ModelOfTable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Coding Style Naming introduced by
The parameter $ModelOfTable is not named in camelCase.

This check marks parameter names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
11
12
    }
13
14
    protected $normalizer;
15
    /**
16
     * Run a select statement and return a single result.
17
     *
18
     * @param  string  $query
19
     * @param  array   $bindings
20
     * @return mixed
21
     */
22
    public function selectOne($query, $bindings = array())
23
    {
24
        $records = parent::select($query, $bindings);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (select() instead of selectOne()). Are you sure this is correct? If so, you might want to change this to $this->select().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
25
        return $records;
26
    }
27
    /**
28
     * Run a select statement against the database.
29
     *
30
     * @param  string  $query
31
     * @param  array   $bindings
32
     * @return \Stidges\LaravelDbNormalizer\Collection
0 ignored issues
show
Documentation introduced by
Should the return type not be array? Also, consider making the array more specific, something like array<String>, or String[].

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

If the return type contains the type array, this check recommends the use of a more specific type like String[] or array<String>.

Loading history...
33
     */
34
    public function select($query, $bindings = array())
35
    {
36
        $records = parent::select($query, $bindings);
37
        return $records;
38
    }
39
}
40
41
42
43
44
45
46
47