Passed
Pull Request — main (#116)
by Andreas
08:51
created

PDOStatementImplementationPhp8   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFetchMode() 0 3 1
A fetchAll() 0 3 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
    public function setFetchMode($mode, ...$args): bool
41
    {
42
        return $this->doSetFetchMode($mode, ...$args);
0 ignored issues
show
Bug introduced by
The method doSetFetchMode() does not exist on Crate\PDO\PDOStatementImplementationPhp8. Did you maybe mean setFetchMode()? ( Ignorable by Annotation )

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

42
        return $this->/** @scrutinizer ignore-call */ doSetFetchMode($mode, ...$args);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

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
    public function fetchAll($mode = null, ...$args): mixed
54
    {
55
        return $this->doFetchAll($mode, ...$args);
0 ignored issues
show
Bug introduced by
It seems like doFetchAll() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

55
        return $this->/** @scrutinizer ignore-call */ doFetchAll($mode, ...$args);
Loading history...
56
    }
57
}
58