Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
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
Kulya
TelegramBot
Commits
cc26b290
Commit
cc26b290
authored
Feb 20, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Command getConfig should return "null" if no config key is found.
parent
1e325d88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Command.php
src/Commands/Command.php
+2
-2
CommandTest.php
tests/Unit/Commands/CommandTest.php
+1
-1
No files found.
src/Commands/Command.php
View file @
cc26b290
...
...
@@ -178,7 +178,7 @@ abstract class Command
/**
* Get command config
*
* Look for config $name if found return it, if not return
empty array
.
* Look for config $name if found return it, if not return
null
.
* If $name is not set return all set config.
*
* @param string|null $name
...
...
@@ -193,7 +193,7 @@ abstract class Command
if
(
isset
(
$this
->
config
[
$name
]))
{
return
$this
->
config
[
$name
];
}
return
[]
;
return
null
;
}
/**
...
...
tests/Unit/Commands/CommandTest.php
View file @
cc26b290
...
...
@@ -191,6 +191,6 @@ class CommandTest extends TestCase
$this
->
assertEquals
([
'config_key'
=>
'config_value'
],
$this
->
command_stub_with_config
->
getConfig
(
null
));
$this
->
assertEquals
([
'config_key'
=>
'config_value'
],
$this
->
command_stub_with_config
->
getConfig
());
$this
->
assertEquals
(
'config_value'
,
$this
->
command_stub_with_config
->
getConfig
(
'config_key'
));
$this
->
assertEquals
(
[]
,
$this
->
command_stub_with_config
->
getConfig
(
'not_config_key'
));
$this
->
assertEquals
(
null
,
$this
->
command_stub_with_config
->
getConfig
(
'not_config_key'
));
}
}
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