-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b630ce
commit d3b1295
Showing
19 changed files
with
324 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Fxp Composer Asset Plugin package. | ||
* | ||
* (c) François Pluchino <francois.pluchino@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fxp\Composer\AssetPlugin\Config; | ||
|
||
/** | ||
* Helper of package config. | ||
* | ||
* @author François Pluchino <francois.pluchino@gmail.com> | ||
*/ | ||
final class Config | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param array $config The config | ||
*/ | ||
public function __construct(array $config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* Get the array config value. | ||
* | ||
* @param string $key The config key | ||
* @param array $default The default value | ||
* | ||
* @return array | ||
*/ | ||
public function getArray($key, array $default = array()) | ||
{ | ||
return $this->get($key, $default); | ||
} | ||
|
||
/** | ||
* Get the config value. | ||
* | ||
* @param string $key The config key | ||
* @param mixed|null $default The default value | ||
* | ||
* @return mixed|null | ||
*/ | ||
public function get($key, $default = null) | ||
{ | ||
return array_key_exists($key, $this->config) | ||
? $this->config[$key] | ||
: $default; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.