Completed
Push — master ( 46dbb7...9c8538 )
by Hong
02:48
created

Select   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 46.88 %

Coupling/Cohesion

Components 0
Dependencies 11

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 11
dl 15
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigs() 15 15 1
A getType() 0 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Query
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Query\Dialect\Common;
16
17
use Phossa2\Query\Traits\Clause\ColTrait;
18
use Phossa2\Query\Traits\Clause\TableTrait;
19
use Phossa2\Query\Traits\Clause\JoinTrait;
20
use Phossa2\Query\Traits\StatementAbstract;
21
use Phossa2\Query\Traits\Clause\WhereTrait;
22
use Phossa2\Query\Traits\Clause\LimitTrait;
23
use Phossa2\Query\Traits\Clause\UnionTrait;
24
use Phossa2\Query\Traits\Clause\ClauseTrait;
25
use Phossa2\Query\Traits\Clause\HavingTrait;
26
use Phossa2\Query\Traits\Clause\GroupTrait;
27
use Phossa2\Query\Traits\Clause\OrderTrait;
28
use Phossa2\Query\Interfaces\Statement\SelectStatementInterface;
29
30
/**
31
 * Select
32
 *
33
 * Implementation of SelectStatementInterface for Common dialect
34
 *
35
 * @package Phossa2\Query
36
 * @author  Hong Zhang <[email protected]>
37
 * @see     StatementAbstract
38
 * @see     SelectStatementInterface
39
 * @version 2.0.0
40
 * @since   2.0.0 added
41
 */
42
class Select extends StatementAbstract implements SelectStatementInterface
43
{
44
    use ClauseTrait, ColTrait, TableTrait, WhereTrait, JoinTrait,
45
        GroupTrait, HavingTrait, OrderTrait, LimitTrait, UnionTrait;
46
47
    /**
48
     * {@inheritDoc}
49
     */
50 View Code Duplication
    protected function getConfigs()/*# : array */
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
    {
52
        return [
53
            'DISTINCT' => '',
54
            'COL' => '',
55
            'TABLE' => 'FROM',
56
            'JOIN' => '',
57
            'WHERE' => 'WHERE',
58
            'GROUP' => 'GROUP BY',
59
            'HAVING' => 'HAVING',
60
            'ORDER' => 'ORDER BY',
61
            'LIMIT' => 'LIMIT',
62
            'UNION' => '',
63
        ];
64
    }
65
66
    /**
67
     * {@inheritDoc}
68
     */
69
    protected function getType()/*# : string */
70
    {
71
        return 'SELECT';
72
    }
73
}
74