Passed
Push — main ( 0ca8fa...68af6e )
by Andreas
02:01
created

PDOStatementImplementationPhp8   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 45
ccs 4
cts 5
cp 0.8
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFetchMode() 0 3 1
A fetchAll() 0 4 1
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
/**
28
 * @internal
29
 */
30
trait PDOStatementImplementationPhp8
31
{
32
    /**
33
     * @deprecated Use one of the fetch- or iterate-related methods.
34
     *
35
     * @param int   $mode
36
     * @param mixed ...$args
37
     *
38
     * @return bool
39
     */
40 14
    public function setFetchMode(int $mode, ...$args)
41
    {
42 14
        return $this->doSetFetchMode($mode, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $params of Crate\PDO\PDOStatementIm...nPhp8::doSetFetchMode() does not expect variable arguments. ( Ignorable by Annotation )

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

42
        return $this->doSetFetchMode($mode, /** @scrutinizer ignore-type */ ...$args);
Loading history...
43
    }
44
45
    /**
46
     * @deprecated Use fetchAllNumeric(), fetchAllAssociative() or fetchFirstColumn() instead.
47
     *
48
     * @param int|null $mode
49
     * @param mixed    ...$args
50
     *
51
     * @return mixed[]
52
     */
53 13
    #[\ReturnTypeWillChange]
54
    public function fetchAll(int $mode = null, ...$args)
55
    {
56 13
        return $this->doFetchAll($mode, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $fetch_argument of Crate\PDO\PDOStatementIm...ationPhp8::doFetchAll() does not expect variable arguments. ( Ignorable by Annotation )

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

56
        return $this->doFetchAll($mode, /** @scrutinizer ignore-type */ ...$args);
Loading history...
57
    }
58
59
    /**
60
     * @param int|null          $mode
61
     * @param int|string|object $params
62
     *
63
     * @return bool
64
     */
65
    abstract public function doSetFetchMode($mode, $params = null);
66
67
    /**
68
     * @param int|null          $fetch_style
69
     * @param int|string|object $fetch_argument
70
     * @param mixed[]           $ctor_args
71
     *
72
     * @return mixed[]
73
     */
74
    abstract public function doFetchAll($fetch_style = null, $fetch_argument = null, $ctor_args = null);
75
}
76