Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b8ee3e

Browse filesBrowse files
committed
Fix type error
1 parent 57d73fc commit 7b8ee3e
Copy full SHA for 7b8ee3e

File tree

2 files changed

+15
-0
lines changed
Filter options

2 files changed

+15
-0
lines changed

‎src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ private function sanitizeQuery($connectionName, $query)
138138
if (!\is_array($query['params'])) {
139139
$query['params'] = [$query['params']];
140140
}
141+
if (!\is_array($query['types'])) {
142+
$query['types'] = [];
143+
}
141144
foreach ($query['params'] as $j => $param) {
142145
if (isset($query['types'][$j])) {
143146
// Transform the param according to the type

‎src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ public function testCollectQueryWithNoParams()
102102
$this->assertTrue($collectedQueries['default'][1]['explainable']);
103103
}
104104

105+
public function testCollectQueryWithNoTypes()
106+
{
107+
$queries = [
108+
['sql' => 'SET sql_mode=(SELECT REPLACE(@@sql_mode, \'ONLY_FULL_GROUP_BY\', \'\'))', 'params' => [], 'types' => null, 'executionMS' => 1],
109+
];
110+
$c = $this->createCollector($queries);
111+
$c->collect(new Request(), new Response());
112+
113+
$collectedQueries = $c->getQueries();
114+
$this->assertSame([], $collectedQueries['default'][0]['types']);
115+
}
116+
105117
public function testReset()
106118
{
107119
$queries = [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.