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
ead04017
Unverified
Commit
ead04017
authored
May 30, 2019
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3570 from jwage/tools-types
Add proper types to Doctrine\DBAL\Tools namespace.
parents
f90c5001
1c48cfe0
Changes
5
Show 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 @
ead04017
...
...
@@ -30,7 +30,7 @@ use function sprintf;
class
ReservedWordsCommand
extends
Command
{
/** @var
string[]
*/
/** @var
array<string, string>
*/
private
$keywordListClasses
=
[
'db2'
=>
DB2Keywords
::
class
,
'mysql'
=>
MySQLKeywords
::
class
,
...
...
@@ -48,13 +48,8 @@ class ReservedWordsCommand extends 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
;
}
...
...
@@ -62,7 +57,7 @@ class ReservedWordsCommand extends Command
/**
* {@inheritdoc}
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
$this
->
setName
(
'dbal:reserved-words'
)
...
...
lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
View file @
ead04017
...
...
@@ -26,7 +26,7 @@ class RunSqlCommand extends Command
/**
* {@inheritdoc}
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
$this
->
setName
(
'dbal:run-sql'
)
...
...
lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
View file @
ead04017
...
...
@@ -20,10 +20,8 @@ class ConsoleRunner
{
/**
* Create a Symfony Console HelperSet
*
* @return HelperSet
*/
public
static
function
createHelperSet
(
Connection
$connection
)
public
static
function
createHelperSet
(
Connection
$connection
)
:
HelperSet
{
return
new
HelperSet
([
'db'
=>
new
ConnectionHelper
(
$connection
),
...
...
@@ -33,11 +31,9 @@ class ConsoleRunner
/**
* Runs console with the given helperset.
*
* @param Command[] $commands
*
* @return void
* @param array<int, Command> $commands
*/
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'
));
...
...
@@ -50,10 +46,7 @@ class ConsoleRunner
$cli
->
run
();
}
/**
* @return void
*/
public
static
function
addCommands
(
Application
$cli
)
public
static
function
addCommands
(
Application
$cli
)
:
void
{
$cli
->
addCommands
([
new
RunSqlCommand
(),
...
...
@@ -64,7 +57,7 @@ class ConsoleRunner
/**
* Prints the instructions to create a configuration file
*/
public
static
function
printCliConfigTemplate
()
public
static
function
printCliConfigTemplate
()
:
void
{
echo
<<<'HELP'
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 @
ead04017
...
...
@@ -29,10 +29,8 @@ class ConnectionHelper extends Helper
/**
* Retrieves the Doctrine database Connection.
*
* @return Connection
*/
public
function
getConnection
()
public
function
getConnection
()
:
Connection
{
return
$this
->
_connection
;
}
...
...
lib/Doctrine/DBAL/Tools/Dumper.php
View file @
ead04017
...
...
@@ -59,7 +59,7 @@ final class Dumper
{
$html
=
ini_get
(
'html_errors'
);
if
(
$html
!==
true
)
{
if
(
$html
!==
'1'
)
{
ini_set
(
'html_errors'
,
'1'
);
}
...
...
@@ -142,11 +142,9 @@ final class Dumper
* 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}
*
* @param object $var
*
* @return mixed
*/
private
static
function
fillReturnWithClassAttributes
(
$var
,
stdClass
$return
,
int
$maxDepth
)
private
static
function
fillReturnWithClassAttributes
(
object
$var
,
stdClass
$return
,
int
$maxDepth
)
{
$clone
=
(
array
)
$var
;
...
...
@@ -162,10 +160,7 @@ final class Dumper
return
$return
;
}
/**
* @param object $object
*/
private
static
function
getClass
(
$object
)
:
string
private
static
function
getClass
(
object
$object
)
:
string
{
$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