Skip to content

Commit 6f4fce6

Browse files
committed
demo
1 parent cefdc85 commit 6f4fce6

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

demo.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
function demo(\PDO $pdo): void
4+
{
5+
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = :adaid');
6+
$stmt->execute([':wrongParamName' => 1]);
7+
8+
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = :adaid');
9+
$stmt->execute(); // missing parameter
10+
11+
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = ? and email = ?');
12+
$stmt->execute([1]); // wrong number of parameters
13+
14+
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = :adaid and email = :email');
15+
$stmt->execute(['adaid' => 1]); // wrong number of parameters
16+
17+
$stmt = $pdo->prepare('SELECT email, adaid FROM ada WHERE adaid = :adaid and email = :email');
18+
$stmt->execute([':email' => '[email protected]']); // wrong number of parameters
19+
}

phpstan.neon.dist

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
includes:
2-
- config/stubFiles.neon
3-
- config/extensions.neon
2+
- config/dba.neon
43

54
parameters:
65
level: max
76

87
paths:
9-
- src/
10-
- tests/
8+
- demo.php
119

1210
bootstrapFiles:
1311
- bootstrap.php
14-
15-
ignoreErrors:
16-
-
17-
message: '#Function Deployer\\runMysqlQuery\(\) should return array<int, array<int, string>>\|null but return statement is missing.#'
18-
path: tests/data/runMysqlQuery.php
19-
-
20-
message: '#.*has no return type specified.#'
21-
path: tests/*
22-
-
23-
message: '#.*return type has no value type specified in iterable type iterable.#'
24-
path: tests/*
25-
26-
excludePaths:
27-
analyseAndScan:
28-
- *fixtures/**

0 commit comments

Comments
 (0)