doctrine /
dbal
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Doctrine\DBAL\Logging; |
||
| 4 | |||
| 5 | use const PHP_EOL; |
||
| 6 | use function count; |
||
| 7 | use function var_dump; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * A SQL logger that logs to the standard output using echo/var_dump. |
||
| 11 | */ |
||
| 12 | class EchoSQLLogger implements SQLLogger |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * {@inheritdoc} |
||
| 16 | */ |
||
| 17 | public function startQuery($sql, ?array $params = null, ?array $types = null) |
||
| 18 | { |
||
| 19 | echo $sql . PHP_EOL; |
||
| 20 | |||
| 21 | if (count($params) > 0) { |
||
| 22 | var_dump($params); |
||
|
0 ignored issues
–
show
Security
Debugging Code
introduced
by
Loading history...
|
|||
| 23 | } |
||
| 24 | |||
| 25 | if (count($types) === 0) { |
||
| 26 | return; |
||
| 27 | } |
||
| 28 | |||
| 29 | var_dump($types); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritdoc} |
||
| 34 | */ |
||
| 35 | public function stopQuery() |
||
| 36 | { |
||
| 37 | } |
||
| 38 | } |
||
| 39 |