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
1c48cfe0
Unverified
Commit
1c48cfe0
authored
May 29, 2019
by
Jonathan H. Wage
Committed by
Sergei Morozov
Nov 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper types to Doctrine\DBAL\Tools namespace.
parent
f90c5001
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
32 deletions
+13
-32
ReservedWordsCommand.php
...trine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
+3
-8
RunSqlCommand.php
lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
+1
-1
ConsoleRunner.php
lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
+5
-12
ConnectionHelper.php
lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php
+1
-3
Dumper.php
lib/Doctrine/DBAL/Tools/Dumper.php
+3
-8
No files found.
lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
View file @
1c48cfe0
...
@@ -30,7 +30,7 @@ use function sprintf;
...
@@ -30,7 +30,7 @@ use function sprintf;
class
ReservedWordsCommand
extends
Command
class
ReservedWordsCommand
extends
Command
{
{
/** @var
string[]
*/
/** @var
array<string, string>
*/
private
$keywordListClasses
=
[
private
$keywordListClasses
=
[
'db2'
=>
DB2Keywords
::
class
,
'db2'
=>
DB2Keywords
::
class
,
'mysql'
=>
MySQLKeywords
::
class
,
'mysql'
=>
MySQLKeywords
::
class
,
...
@@ -48,13 +48,8 @@ class ReservedWordsCommand extends Command
...
@@ -48,13 +48,8 @@ class ReservedWordsCommand extends Command
/**
/**
* If you want to add or replace a keywords list use this command.
* If you want to add or replace a keywords list use this command.
*
* @param string $name
* @param string $class
*
* @return void
*/
*/
public
function
setKeywordListClass
(
$name
,
$class
)
public
function
setKeywordListClass
(
string
$name
,
string
$class
)
:
void
{
{
$this
->
keywordListClasses
[
$name
]
=
$class
;
$this
->
keywordListClasses
[
$name
]
=
$class
;
}
}
...
@@ -62,7 +57,7 @@ class ReservedWordsCommand extends Command
...
@@ -62,7 +57,7 @@ class ReservedWordsCommand extends Command
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
{
$this
$this
->
setName
(
'dbal:reserved-words'
)
->
setName
(
'dbal:reserved-words'
)
...
...
lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
View file @
1c48cfe0
...
@@ -26,7 +26,7 @@ class RunSqlCommand extends Command
...
@@ -26,7 +26,7 @@ class RunSqlCommand extends Command
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
{
$this
$this
->
setName
(
'dbal:run-sql'
)
->
setName
(
'dbal:run-sql'
)
...
...
lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
View file @
1c48cfe0
...
@@ -20,10 +20,8 @@ class ConsoleRunner
...
@@ -20,10 +20,8 @@ class ConsoleRunner
{
{
/**
/**
* Create a Symfony Console HelperSet
* Create a Symfony Console HelperSet
*
* @return HelperSet
*/
*/
public
static
function
createHelperSet
(
Connection
$connection
)
public
static
function
createHelperSet
(
Connection
$connection
)
:
HelperSet
{
{
return
new
HelperSet
([
return
new
HelperSet
([
'db'
=>
new
ConnectionHelper
(
$connection
),
'db'
=>
new
ConnectionHelper
(
$connection
),
...
@@ -33,11 +31,9 @@ class ConsoleRunner
...
@@ -33,11 +31,9 @@ class ConsoleRunner
/**
/**
* Runs console with the given helperset.
* Runs console with the given helperset.
*
*
* @param Command[] $commands
* @param array<int, Command> $commands
*
* @return void
*/
*/
public
static
function
run
(
HelperSet
$helperSet
,
$commands
=
[])
public
static
function
run
(
HelperSet
$helperSet
,
array
$commands
=
[])
:
void
{
{
$cli
=
new
Application
(
'Doctrine Command Line Interface'
,
Versions
::
getVersion
(
'doctrine/dbal'
));
$cli
=
new
Application
(
'Doctrine Command Line Interface'
,
Versions
::
getVersion
(
'doctrine/dbal'
));
...
@@ -50,10 +46,7 @@ class ConsoleRunner
...
@@ -50,10 +46,7 @@ class ConsoleRunner
$cli
->
run
();
$cli
->
run
();
}
}
/**
public
static
function
addCommands
(
Application
$cli
)
:
void
* @return void
*/
public
static
function
addCommands
(
Application
$cli
)
{
{
$cli
->
addCommands
([
$cli
->
addCommands
([
new
RunSqlCommand
(),
new
RunSqlCommand
(),
...
@@ -64,7 +57,7 @@ class ConsoleRunner
...
@@ -64,7 +57,7 @@ class ConsoleRunner
/**
/**
* Prints the instructions to create a configuration file
* Prints the instructions to create a configuration file
*/
*/
public
static
function
printCliConfigTemplate
()
public
static
function
printCliConfigTemplate
()
:
void
{
{
echo
<<<'HELP'
echo
<<<'HELP'
You are missing a "cli-config.php" or "config/cli-config.php" file in your
You are missing a "cli-config.php" or "config/cli-config.php" file in your
...
...
lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php
View file @
1c48cfe0
...
@@ -29,10 +29,8 @@ class ConnectionHelper extends Helper
...
@@ -29,10 +29,8 @@ class ConnectionHelper extends Helper
/**
/**
* Retrieves the Doctrine database Connection.
* Retrieves the Doctrine database Connection.
*
* @return Connection
*/
*/
public
function
getConnection
()
public
function
getConnection
()
:
Connection
{
{
return
$this
->
_connection
;
return
$this
->
_connection
;
}
}
...
...
lib/Doctrine/DBAL/Tools/Dumper.php
View file @
1c48cfe0
...
@@ -59,7 +59,7 @@ final class Dumper
...
@@ -59,7 +59,7 @@ final class Dumper
{
{
$html
=
ini_get
(
'html_errors'
);
$html
=
ini_get
(
'html_errors'
);
if
(
$html
!==
true
)
{
if
(
$html
!==
'1'
)
{
ini_set
(
'html_errors'
,
'1'
);
ini_set
(
'html_errors'
,
'1'
);
}
}
...
@@ -142,11 +142,9 @@ final class Dumper
...
@@ -142,11 +142,9 @@ final class Dumper
* Fill the $return variable with class attributes
* Fill the $return variable with class attributes
* Based on obj2array function from {@see https://secure.php.net/manual/en/function.get-object-vars.php#47075}
* Based on obj2array function from {@see https://secure.php.net/manual/en/function.get-object-vars.php#47075}
*
*
* @param object $var
*
* @return mixed
* @return mixed
*/
*/
private
static
function
fillReturnWithClassAttributes
(
$var
,
stdClass
$return
,
int
$maxDepth
)
private
static
function
fillReturnWithClassAttributes
(
object
$var
,
stdClass
$return
,
int
$maxDepth
)
{
{
$clone
=
(
array
)
$var
;
$clone
=
(
array
)
$var
;
...
@@ -162,10 +160,7 @@ final class Dumper
...
@@ -162,10 +160,7 @@ final class Dumper
return
$return
;
return
$return
;
}
}
/**
private
static
function
getClass
(
object
$object
)
:
string
* @param object $object
*/
private
static
function
getClass
(
$object
)
:
string
{
{
$class
=
get_class
(
$object
);
$class
=
get_class
(
$object
);
...
...
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