PDOStatement::execute()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 3
nc 2
nop 1
1
<?php
2
3
/**
4
 * This file is part of the Kdyby (http://www.kdyby.org)
5
 *
6
 * Copyright (c) 2008 Filip Procházka ([email protected])
7
 *
8
 * For the full copyright and license information, please view the file license.txt that was distributed with this source code.
9
 */
10
11
namespace Kdyby\Doctrine;
12
13
use Doctrine\DBAL\Statement;
14
use Kdyby;
15
use Nette;
16
17
18
19
/**
20
 * @author Filip Procházka <[email protected]>
21
 */
22
class PDOStatement extends Statement
23
{
24
25
	/**
26
	 * {@inheritdoc}
27
	 */
28
	public function execute($params = NULL)
29
	{
30
		try {
31
			return parent::execute($params);
0 ignored issues
show
Bug introduced by
It seems like $params defined by parameter $params on line 28 can also be of type array; however, Doctrine\DBAL\Statement::execute() does only seem to accept array<integer,*>|null, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
32
33
		} catch (\Exception $e) {
34
			/** @var \Kdyby\Doctrine\Connection $conn */
35
			$conn = $this->conn;
36
			throw $conn->resolveException($e, $this->sql, (is_array($params) ? $params : []) + $this->params);
0 ignored issues
show
Deprecated Code introduced by
The method Kdyby\Doctrine\Connection::resolveException() has been deprecated.

This method has been deprecated.

Loading history...
37
		}
38
	}
39
40
}
41