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
6a45e830
Unverified
Commit
6a45e830
authored
Jul 24, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use __METHOD__ and ::class to build exception messages
parent
eefb771e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
11 deletions
+29
-11
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+6
-2
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+9
-3
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+9
-3
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+2
-2
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+3
-1
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
6a45e830
...
@@ -1423,7 +1423,9 @@ abstract class AbstractPlatform
...
@@ -1423,7 +1423,9 @@ abstract class AbstractPlatform
}
}
if
(
!
is_string
(
$table
))
{
if
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $table parameter to be string or '
.
Table
::
class
.
'.'
);
}
}
if
(
$this
->
_eventManager
!==
null
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaDropTable
))
{
if
(
$this
->
_eventManager
!==
null
&&
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaDropTable
))
{
...
@@ -1471,7 +1473,9 @@ abstract class AbstractPlatform
...
@@ -1471,7 +1473,9 @@ abstract class AbstractPlatform
if
(
$index
instanceof
Index
)
{
if
(
$index
instanceof
Index
)
{
$index
=
$index
->
getQuotedName
(
$this
);
$index
=
$index
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$index
))
{
}
elseif
(
!
is_string
(
$index
))
{
throw
new
InvalidArgumentException
(
'AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $index parameter to be string or '
.
Index
::
class
.
'.'
);
}
}
return
'DROP INDEX '
.
$index
;
return
'DROP INDEX '
.
$index
;
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
6a45e830
...
@@ -420,13 +420,17 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -420,13 +420,17 @@ class DrizzlePlatform extends AbstractPlatform
}
elseif
(
is_string
(
$index
))
{
}
elseif
(
is_string
(
$index
))
{
$indexName
=
$index
;
$indexName
=
$index
;
}
else
{
}
else
{
throw
new
InvalidArgumentException
(
'DrizzlePlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $index parameter to be string or '
.
Index
::
class
.
'.'
);
}
}
if
(
$table
instanceof
Table
)
{
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'DrizzlePlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $table parameter to be string or '
.
Table
::
class
.
'.'
);
}
}
if
(
$index
instanceof
Index
&&
$index
->
isPrimary
())
{
if
(
$index
instanceof
Index
&&
$index
->
isPrimary
())
{
...
@@ -571,7 +575,9 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -571,7 +575,9 @@ class DrizzlePlatform extends AbstractPlatform
if
(
$table
instanceof
Table
)
{
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $table parameter to be string or '
.
Table
::
class
.
'.'
);
}
}
return
'DROP TEMPORARY TABLE '
.
$table
;
return
'DROP TEMPORARY TABLE '
.
$table
;
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
6a45e830
...
@@ -1006,13 +1006,17 @@ SQL
...
@@ -1006,13 +1006,17 @@ SQL
}
elseif
(
is_string
(
$index
))
{
}
elseif
(
is_string
(
$index
))
{
$indexName
=
$index
;
$indexName
=
$index
;
}
else
{
}
else
{
throw
new
InvalidArgumentException
(
'MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $index parameter to be string or '
.
Index
::
class
.
'.'
);
}
}
if
(
$table
instanceof
Table
)
{
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $table parameter to be string or '
.
Table
::
class
.
'.'
);
}
}
if
(
$index
instanceof
Index
&&
$index
->
isPrimary
())
{
if
(
$index
instanceof
Index
&&
$index
->
isPrimary
())
{
...
@@ -1132,7 +1136,9 @@ SQL
...
@@ -1132,7 +1136,9 @@ SQL
if
(
$table
instanceof
Table
)
{
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'getDropTemporaryTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $table parameter to be string or '
.
Table
::
class
.
'.'
);
}
}
return
'DROP TEMPORARY TABLE '
.
$table
;
return
'DROP TEMPORARY TABLE '
.
$table
;
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
6a45e830
...
@@ -549,7 +549,7 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -549,7 +549,7 @@ class SQLAnywherePlatform extends AbstractPlatform
if
(
!
is_string
(
$index
))
{
if
(
!
is_string
(
$index
))
{
throw
new
InvalidArgumentException
(
throw
new
InvalidArgumentException
(
'SQLAnywherePlatform::getDropIndexSQL
() expects $index parameter to be string or '
.
Index
::
class
.
'.'
__METHOD__
.
'
() expects $index parameter to be string or '
.
Index
::
class
.
'.'
);
);
}
}
...
@@ -563,7 +563,7 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -563,7 +563,7 @@ class SQLAnywherePlatform extends AbstractPlatform
if
(
!
is_string
(
$table
))
{
if
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
throw
new
InvalidArgumentException
(
'SQLAnywherePlatform::getDropIndexSQL
() expects $table parameter to be string or '
.
Index
::
class
.
'.'
__METHOD__
.
'
() expects $table parameter to be string or '
.
Index
::
class
.
'.'
);
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
6a45e830
...
@@ -213,7 +213,9 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -213,7 +213,9 @@ class SQLServerPlatform extends AbstractPlatform
if
(
$index
instanceof
Index
)
{
if
(
$index
instanceof
Index
)
{
$index
=
$index
->
getQuotedName
(
$this
);
$index
=
$index
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$index
))
{
}
elseif
(
!
is_string
(
$index
))
{
throw
new
InvalidArgumentException
(
'AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'
);
throw
new
InvalidArgumentException
(
__METHOD__
.
'() expects $index parameter to be string or '
.
Index
::
class
.
'.'
);
}
}
if
(
!
isset
(
$table
))
{
if
(
!
isset
(
$table
))
{
...
...
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