Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
997671bc
Unverified
Commit
997671bc
authored
Mar 08, 2018
by
Benjamin Morel
Committed by
Sergei Morozov
Nov 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the SQLLogger interface signature
parent
5939e496
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
22 deletions
+16
-22
DebugStack.php
lib/Doctrine/DBAL/Logging/DebugStack.php
+2
-2
EchoSQLLogger.php
lib/Doctrine/DBAL/Logging/EchoSQLLogger.php
+2
-2
LoggerChain.php
lib/Doctrine/DBAL/Logging/LoggerChain.php
+3
-5
NullLogger.php
lib/Doctrine/DBAL/Logging/NullLogger.php
+2
-2
SQLLogger.php
lib/Doctrine/DBAL/Logging/SQLLogger.php
+5
-9
DebugStackTest.php
tests/Doctrine/Tests/DBAL/Logging/DebugStackTest.php
+2
-2
No files found.
lib/Doctrine/DBAL/Logging/DebugStack.php
View file @
997671bc
...
...
@@ -32,7 +32,7 @@ class DebugStack implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
startQuery
(
$sql
,
?
array
$params
=
null
,
?
array
$types
=
null
)
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
{
if
(
!
$this
->
enabled
)
{
return
;
...
...
@@ -45,7 +45,7 @@ class DebugStack implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
stopQuery
()
public
function
stopQuery
()
:
void
{
if
(
!
$this
->
enabled
)
{
return
;
...
...
lib/Doctrine/DBAL/Logging/EchoSQLLogger.php
View file @
997671bc
...
...
@@ -13,7 +13,7 @@ class EchoSQLLogger implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
startQuery
(
$sql
,
?
array
$params
=
null
,
?
array
$types
=
null
)
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
{
echo
$sql
.
PHP_EOL
;
...
...
@@ -31,7 +31,7 @@ class EchoSQLLogger implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
stopQuery
()
public
function
stopQuery
()
:
void
{
}
}
lib/Doctrine/DBAL/Logging/LoggerChain.php
View file @
997671bc
...
...
@@ -12,10 +12,8 @@ class LoggerChain implements SQLLogger
/**
* Adds a logger in the chain.
*
* @return void
*/
public
function
addLogger
(
SQLLogger
$logger
)
public
function
addLogger
(
SQLLogger
$logger
)
:
void
{
$this
->
loggers
[]
=
$logger
;
}
...
...
@@ -23,7 +21,7 @@ class LoggerChain implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
startQuery
(
$sql
,
?
array
$params
=
null
,
?
array
$types
=
null
)
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
{
foreach
(
$this
->
loggers
as
$logger
)
{
$logger
->
startQuery
(
$sql
,
$params
,
$types
);
...
...
@@ -33,7 +31,7 @@ class LoggerChain implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
stopQuery
()
public
function
stopQuery
()
:
void
{
foreach
(
$this
->
loggers
as
$logger
)
{
$logger
->
stopQuery
();
...
...
lib/Doctrine/DBAL/Logging/NullLogger.php
View file @
997671bc
...
...
@@ -10,14 +10,14 @@ final class NullLogger implements SQLLogger
/**
* {@inheritdoc}
*/
public
function
startQuery
(
$sql
,
array
$params
=
null
,
array
$types
=
null
)
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
{
}
/**
* {@inheritdoc}
*/
public
function
stopQuery
()
public
function
stopQuery
()
:
void
{
}
}
lib/Doctrine/DBAL/Logging/SQLLogger.php
View file @
997671bc
...
...
@@ -11,17 +11,13 @@ interface SQLLogger
* Logs a SQL statement somewhere.
*
* @param string $sql The SQL to be executed.
* @param mixed[]|null $params The SQL parameters.
* @param int[]|string[]|null $types The SQL parameter types.
*
* @return void
* @param mixed[] $params The SQL parameters.
* @param int[]|string[] $types The SQL parameter types.
*/
public
function
startQuery
(
$sql
,
?
array
$params
=
null
,
?
array
$types
=
null
)
;
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
;
/**
* Marks the last started query as stopped. This can be used for timing of queries.
*
* @return void
*/
public
function
stopQuery
();
public
function
stopQuery
()
:
void
;
}
tests/Doctrine/Tests/DBAL/Logging/DebugStackTest.php
View file @
997671bc
...
...
@@ -27,8 +27,8 @@ class DebugStackTest extends DbalTestCase
[
1
=>
[
'sql'
=>
'SELECT column FROM table'
,
'params'
=>
null
,
'types'
=>
null
,
'params'
=>
[]
,
'types'
=>
[]
,
'executionMS'
=>
0
,
],
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment