EchoSQLLogger::startQuery()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 3
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\DBAL\Logging;
21
22
use const PHP_EOL;
23
use function var_dump;
24
25
/**
26
 * A SQL logger that logs to the standard output using echo/var_dump.
27
 *
28
 * @link   www.doctrine-project.org
29
 * @since  2.0
30
 * @author Benjamin Eberlei <[email protected]>
31
 * @author Guilherme Blanco <[email protected]>
32
 * @author Jonathan Wage <[email protected]>
33
 * @author Roman Borschel <[email protected]>
34
 */
35
class EchoSQLLogger implements SQLLogger
36
{
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function startQuery($sql, array $params = null, array $types = null)
41
    {
42
        echo $sql . PHP_EOL;
43
44
        if ($params) {
45
            var_dump($params);
0 ignored issues
show
Security Debugging Code introduced by
\var_dump($params); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
46
        }
47
48
        if ($types) {
49
            var_dump($types);
50
        }
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function stopQuery()
57
    {
58
    }
59
}
60