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
4f7c86f8
Unverified
Commit
4f7c86f8
authored
Jun 28, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace InvalidArgumentException in the mysqli driver with a driver-level one
parent
2422fedd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
FailedReadingStreamOffset.php
src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php
+2
-2
NonStreamResourceUsedAsLargeObject.php
...r/Mysqli/Exception/NonStreamResourceUsedAsLargeObject.php
+24
-0
Statement.php
src/Driver/Mysqli/Statement.php
+2
-2
No files found.
src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php
View file @
4f7c86f8
...
@@ -15,8 +15,8 @@ use function sprintf;
...
@@ -15,8 +15,8 @@ use function sprintf;
*/
*/
final
class
FailedReadingStreamOffset
extends
AbstractException
final
class
FailedReadingStreamOffset
extends
AbstractException
{
{
public
static
function
new
(
int
$
offset
)
:
self
public
static
function
new
(
int
$
parameter
)
:
self
{
{
return
new
self
(
sprintf
(
'Failed reading the stream resource for parameter
offset %d.'
,
$offset
));
return
new
self
(
sprintf
(
'Failed reading the stream resource for parameter
#%d.'
,
$parameter
));
}
}
}
}
src/Driver/Mysqli/Exception/NonStreamResourceUsedAsLargeObject.php
0 → 100644
View file @
4f7c86f8
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\Mysqli\Exception
;
use
Doctrine\DBAL\Driver\AbstractException
;
use
function
sprintf
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
NonStreamResourceUsedAsLargeObject
extends
AbstractException
{
public
static
function
new
(
int
$parameter
)
:
self
{
return
new
self
(
sprintf
(
'The resource passed as a LARGE_OBJECT parameter #%d must be of type "stream"'
,
$parameter
)
);
}
}
src/Driver/Mysqli/Statement.php
View file @
4f7c86f8
...
@@ -6,10 +6,10 @@ use Doctrine\DBAL\Driver\Exception;
...
@@ -6,10 +6,10 @@ use Doctrine\DBAL\Driver\Exception;
use
Doctrine\DBAL\Driver\Exception\UnknownParameterType
;
use
Doctrine\DBAL\Driver\Exception\UnknownParameterType
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionError
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\FailedReadingStreamOffset
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\FailedReadingStreamOffset
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\NonStreamResourceUsedAsLargeObject
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\StatementError
;
use
Doctrine\DBAL\Driver\Mysqli\Exception\StatementError
;
use
Doctrine\DBAL\Driver\Result
as
ResultInterface
;
use
Doctrine\DBAL\Driver\Result
as
ResultInterface
;
use
Doctrine\DBAL\Driver\Statement
as
StatementInterface
;
use
Doctrine\DBAL\Driver\Statement
as
StatementInterface
;
use
Doctrine\DBAL\Exception\InvalidArgumentException
;
use
Doctrine\DBAL\ParameterType
;
use
Doctrine\DBAL\ParameterType
;
use
mysqli
;
use
mysqli
;
use
mysqli_stmt
;
use
mysqli_stmt
;
...
@@ -160,7 +160,7 @@ final class Statement implements StatementInterface
...
@@ -160,7 +160,7 @@ final class Statement implements StatementInterface
if
(
$types
[
$parameter
-
1
]
===
static
::
$_paramTypeMap
[
ParameterType
::
LARGE_OBJECT
])
{
if
(
$types
[
$parameter
-
1
]
===
static
::
$_paramTypeMap
[
ParameterType
::
LARGE_OBJECT
])
{
if
(
is_resource
(
$value
))
{
if
(
is_resource
(
$value
))
{
if
(
get_resource_type
(
$value
)
!==
'stream'
)
{
if
(
get_resource_type
(
$value
)
!==
'stream'
)
{
throw
new
InvalidArgumentException
(
'Resources passed with the LARGE_OBJECT parameter type must be stream resources.'
);
throw
NonStreamResourceUsedAsLargeObject
::
new
(
$parameter
);
}
}
$streams
[
$parameter
]
=
$value
;
$streams
[
$parameter
]
=
$value
;
...
...
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