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
0306cc6f
Commit
0306cc6f
authored
Jan 16, 2020
by
Benjamin Morel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix phpstan errors
parent
51fa9459
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
40 deletions
+22
-40
Connection.php
lib/Doctrine/DBAL/Connection.php
+9
-9
SQLLogger.php
lib/Doctrine/DBAL/Logging/SQLLogger.php
+5
-3
QueryBuilder.php
lib/Doctrine/DBAL/Query/QueryBuilder.php
+1
-1
Table.php
lib/Doctrine/DBAL/Schema/Table.php
+4
-10
phpstan.neon.dist
phpstan.neon.dist
+2
-2
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+0
-14
MySqlInheritCharsetTest.php
tests/Doctrine/Tests/DBAL/Schema/MySqlInheritCharsetTest.php
+1
-1
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
0306cc6f
...
...
@@ -558,9 +558,9 @@ class Connection implements DriverConnection
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param string
$table The SQL expression of the table on which to delete.
* @param array<string, mixed>
$identifier The deletion criteria. An associative array containing column-value pairs.
* @param array<int
, int|string>|array<
string, int|string> $types The query parameter types.
* @param string $table The SQL expression of the table on which to delete.
* @param array<string, mixed> $identifier The deletion criteria. An associative array containing column-value pairs.
* @param array<int
|
string, int|string> $types The query parameter types.
*
* @return int The number of affected rows.
*
...
...
@@ -696,8 +696,8 @@ class Connection implements DriverConnection
/**
* Extract ordered type list from an ordered column list and type map.
*
* @param array<int, string> $columnList
* @param array<int, int|string> $types The query parameter types.
* @param array<int, string>
$columnList
* @param array<int
|string
, int|string> $types The query parameter types.
*
* @return array<int, int>|array<int, string>
*/
...
...
@@ -1358,8 +1358,8 @@ class Connection implements DriverConnection
/**
* Gets the binding type of a given type. The given type can be a PDO or DBAL mapping type.
*
* @param mixed $value The value to bind.
* @param int|string|null $type The type to bind (PDO or DBAL).
* @param mixed
$value The value to bind.
* @param int|string|
Type|
null $type The type to bind (PDO or DBAL).
*
* @return array<int, mixed> [0] => the (escaped) value, [1] => the binding type.
*/
...
...
@@ -1384,8 +1384,8 @@ class Connection implements DriverConnection
* @internal This is a purely internal method. If you rely on this method, you are advised to
* copy/paste the code as this method may change, or be removed without prior notice.
*
* @param array<int, mixed>|array<string, mixed> $params
* @param array<int, int|string
>|array<string, int|string
> $types The query parameter types.
* @param array<int, mixed>|array<string, mixed>
$params
* @param array<int, int|string
|Type>|array<string, int|string|Type
> $types The query parameter types.
*
* @return array<int, mixed>|array<string, mixed>
*/
...
...
lib/Doctrine/DBAL/Logging/SQLLogger.php
View file @
0306cc6f
...
...
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace
Doctrine\DBAL\Logging
;
use
Doctrine\DBAL\Types\Type
;
/**
* Interface for SQL loggers.
*/
...
...
@@ -12,9 +14,9 @@ interface SQLLogger
/**
* Logs a SQL statement somewhere.
*
* @param string $sql The SQL to be executed.
* @param mixed[] $params The SQL parameters.
* @param int[]|string[] $types The SQL parameter types.
* @param string
$sql The SQL to be executed.
* @param mixed[]
$params The SQL parameters.
* @param int[]|string[]
|Type[]
$types The SQL parameter types.
*/
public
function
startQuery
(
string
$sql
,
array
$params
=
[],
array
$types
=
[])
:
void
;
...
...
lib/Doctrine/DBAL/Query/QueryBuilder.php
View file @
0306cc6f
...
...
@@ -954,7 +954,7 @@ class QueryBuilder
* );
* </code>
*
* @param array<
int
, mixed> $values The values to specify for the insert query indexed by column names.
* @param array<
string
, mixed> $values The values to specify for the insert query indexed by column names.
*
* @return $this This QueryBuilder instance.
*/
...
...
lib/Doctrine/DBAL/Schema/Table.php
View file @
0306cc6f
...
...
@@ -840,9 +840,9 @@ class Table extends AbstractAsset
}
/**
* @param array<
string|int, string>
$columns
* @param array<int, string>
$flags
* @param array<string, mixed>
$options
* @param array<
int, string>
$columns
* @param array<int, string> $flags
* @param array<string, mixed> $options
*
* @throws SchemaException
*/
...
...
@@ -852,13 +852,7 @@ class Table extends AbstractAsset
throw
IndexNameInvalid
::
new
(
$indexName
);
}
foreach
(
$columns
as
$index
=>
$value
)
{
if
(
is_string
(
$index
))
{
$columnName
=
$index
;
}
else
{
$columnName
=
$value
;
}
foreach
(
$columns
as
$columnName
)
{
if
(
!
$this
->
hasColumn
(
$columnName
))
{
throw
ColumnDoesNotExist
::
new
(
$columnName
,
$this
->
_name
);
}
...
...
phpstan.neon.dist
View file @
0306cc6f
...
...
@@ -16,8 +16,8 @@ parameters:
# https://bugs.php.net/bug.php?id=78126
- '~^Call to an undefined method PDO::sqliteCreateFunction\(\)\.\z~'
# https://github.com/phpstan/phpstan/issues/
184
7
- '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\
QueryException::nonUniqueAlias\(\) expects array<string>, array<int, int
|string> given\.\z~'
# https://github.com/phpstan/phpstan/issues/
285
7
- '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\
Exception\\NonUniqueAlias::new\(\) expects array<string>, array<int, int\
|string> given\.\z~'
# legacy remnants from doctrine/common
- '~^Class Doctrine\\Common\\(Collections\\Collection|Persistence\\Proxy) not found\.\z~'
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
0306cc6f
...
...
@@ -617,20 +617,6 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
));
}
public
function
testCannotGenerateDropIndexSQLWithInvalidIndexParameter
()
:
void
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
$this
->
platform
->
getDropIndexSQL
([
'index'
],
'table'
);
}
public
function
testCannotGenerateDropIndexSQLWithInvalidTableParameter
()
:
void
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
$this
->
platform
->
getDropIndexSQL
(
'index'
,
[
'table'
]);
}
public
function
testGeneratesSQLSnippets
()
:
void
{
self
::
assertEquals
(
'STRING(column1, "string1", column2, "string2")'
,
$this
->
platform
->
getConcatExpression
(
...
...
tests/Doctrine/Tests/DBAL/Schema/MySqlInheritCharsetTest.php
View file @
0306cc6f
...
...
@@ -66,7 +66,7 @@ class MySqlInheritCharsetTest extends TestCase
}
/**
* @param
string[]
$overrideOptions
* @param
array<string, mixed>
$overrideOptions
*
* @return string[]
*/
...
...
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