PDOImplementationPhp8::query()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 3
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
/**
3
 * Licensed to CRATE Technology GmbH("Crate") under one or more contributor
4
 * license agreements.  See the NOTICE file distributed with this work for
5
 * additional information regarding copyright ownership.  Crate licenses
6
 * this file to you under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.  You may
8
 * obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15
 * License for the specific language governing permissions and limitations
16
 * under the License.
17
 *
18
 * However, if you have executed another commercial license agreement
19
 * with Crate these terms will supersede the license and you may use the
20
 * software solely pursuant to the terms of the relevant commercial agreement.
21
 */
22
23
declare(strict_types=1);
24
25
namespace Crate\PDO;
26
27
use Crate\PDO\Exception\UnsupportedException;
28
29
/**
30
 * @internal
31
 */
32
trait PDOImplementationPhp8
33
{
34
    /**
35
     * @param string|null $query
36
     * @param int|null $fetchMode
37
     * @param mixed ...$fetchModeArgs
38
     * @return PDOStatement
39
     */
40 6
    public function query(?string $query = null, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement
0 ignored issues
show
Unused Code introduced by
The parameter $fetchModeArgs is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

40
    public function query(?string $query = null, ?int $fetchMode = null, /** @scrutinizer ignore-unused */ mixed ...$fetchModeArgs): PDOStatement

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

Loading history...
41
    {
42 6
        if ($fetchMode !== null) {
43 5
            throw new UnsupportedException('PDOCrateDB::query $fetchMode not implemented yet');
44
        }
45
        // FIXME: return $this->doQuery($query, $fetchMode, ...$fetchModeArgs);
46 1
        return $this->doQuery($query);
47
    }
48
49
    /**
50
     * @param $statement
51
     * @return PDOStatement
52
     */
53
    abstract public function doQuery($statement);
54
}
55