Failed Conditions
Push — master ( 41502d...bb8aaf )
by Yangsin
35:17
created

RowNumberOverFunction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSql() 0 6 1
A parse() 0 4 1
1
<?php
2
3
/*
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the MIT license. For more information, see
18
 * <http://www.doctrine-project.org>.
19
 */
20
21
namespace Eccube\Doctrine\ORM\Tools\Pagination;
22
23
use Doctrine\ORM\ORMException;
24
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
25
26
27
/**
28
 * RowNumberOverFunction
29
 *
30
 * Provides ROW_NUMBER() OVER(ORDER BY...) construct for use in LimitSubqueryOutputWalker
31
 *
32
 * @since   2.5
33
 * @author  Bill Schaller <[email protected]>
34
 */
35
class RowNumberOverFunction extends FunctionNode
36
{
37
    /**
38
     * @var \Doctrine\ORM\Query\AST\OrderByClause
39
     */
40
    public $orderByClause;
41
42
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$sqlWalker" missing
Loading history...
43
     * @override
44
     */
0 ignored issues
show
introduced by
Missing @return tag in function comment
Loading history...
45 10
    public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
46
    {
47 10
        return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause(
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
48 10
            $this->orderByClause
49 10
        )) . ')';
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
50
    }
51
52
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$parser" missing
Loading history...
53
     * @override
54
     *
55
     * @throws ORMException
56
     */
57
    public function parse(\Doctrine\ORM\Query\Parser $parser)
58
    {
59
        throw new ORMException("The RowNumberOverFunction is not intended for, nor is it enabled for use in DQL.");
60
    }
61
}
62