for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FMUP;
/**
* Class Config
* @package FMUP
*/
class Config implements Config\ConfigInterface
{
* @var array
private $params = array();
* Retrieve defined param
* @param string $paramName
* @return array|null
public function get($paramName = null)
if (true == is_null($paramName)) {
===
When comparing two booleans, it is generally considered safer to use the strict comparison operator.
return $this->params;
}
return $this->has($paramName) ? $this->params[$paramName] : null;
* Define a param
* @param mixed $value default null
* @return $this
public function set($paramName, $value = null)
$this->params[$paramName] = $value;
return $this;
* Merge an array with current config
* @param array $paramArray
* @param bool $before Merge before (default : false)
public function mergeConfig(array $paramArray = array(), $before = false)
if ($before) {
$this->params = $this->params + $paramArray;
} else {
$this->params = $paramArray + $this->params;
* Is a param defined
* @return bool
public function has($paramName)
return isset($this->params[$paramName]);
When comparing two booleans, it is generally considered safer to use the strict comparison operator.