mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-05 14:37:27 +02:00
Applied fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
3663603b80
commit
fe1f144ec3
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Structural\DependencyInjection;
|
||||
|
||||
/**
|
||||
* class AbstractConfig
|
||||
* class AbstractConfig.
|
||||
*/
|
||||
abstract class AbstractConfig
|
||||
{
|
||||
|
@@ -3,17 +3,18 @@
|
||||
namespace DesignPatterns\Structural\DependencyInjection;
|
||||
|
||||
/**
|
||||
* class ArrayConfig
|
||||
* class ArrayConfig.
|
||||
*
|
||||
* uses array as data source
|
||||
*/
|
||||
class ArrayConfig extends AbstractConfig implements Parameters
|
||||
{
|
||||
/**
|
||||
* Get parameter
|
||||
* Get parameter.
|
||||
*
|
||||
* @param string|int $key
|
||||
* @param null $default
|
||||
* @param null $default
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $default = null)
|
||||
@@ -21,14 +22,15 @@ class ArrayConfig extends AbstractConfig implements Parameters
|
||||
if (isset($this->storage[$key])) {
|
||||
return $this->storage[$key];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set parameter
|
||||
* Set parameter.
|
||||
*
|
||||
* @param string|int $key
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function set($key, $value)
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace DesignPatterns\Structural\DependencyInjection;
|
||||
|
||||
/**
|
||||
* Class Connection
|
||||
* Class Connection.
|
||||
*/
|
||||
class Connection
|
||||
{
|
||||
@@ -26,7 +26,7 @@ class Connection
|
||||
}
|
||||
|
||||
/**
|
||||
* connection using the injected config
|
||||
* connection using the injected config.
|
||||
*/
|
||||
public function connect()
|
||||
{
|
||||
@@ -42,6 +42,7 @@ class Connection
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
public function getHost()
|
||||
{
|
||||
return $this->host;
|
||||
|
@@ -3,12 +3,12 @@
|
||||
namespace DesignPatterns\Structural\DependencyInjection;
|
||||
|
||||
/**
|
||||
* Parameters interface
|
||||
* Parameters interface.
|
||||
*/
|
||||
interface Parameters
|
||||
{
|
||||
/**
|
||||
* Get parameter
|
||||
* Get parameter.
|
||||
*
|
||||
* @param string|int $key
|
||||
*
|
||||
@@ -17,7 +17,7 @@ interface Parameters
|
||||
public function get($key);
|
||||
|
||||
/**
|
||||
* Set parameter
|
||||
* Set parameter.
|
||||
*
|
||||
* @param string|int $key
|
||||
* @param mixed $value
|
||||
|
Reference in New Issue
Block a user