Skip to content

Commit

Permalink
[core] rename $param to $inputs
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Mazière <[email protected]>
  • Loading branch information
Pierre Mazière committed Aug 28, 2016
1 parent d1715f6 commit 2047955
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ protected function getQueriedContext(){
* Note : you can define a cache with "setCache"
* @param array array with expected bridge paramters
*/
public function setDatas(array $param){
public function setDatas(array $inputs){
if(!is_null($this->cache)){
$this->cache->prepare($param);
$this->cache->prepare($inputs);
$time = $this->cache->getTime();
} else {
$time = false;
Expand All @@ -259,16 +259,16 @@ public function setDatas(array $param){
return;
}

if(empty($this->parameters) && !empty($param)){
if(empty($this->parameters) && !empty($inputs)){
$this->returnClientError('Invalid parameters value(s)');
};

if(!$this->validateData($param)){
if(!$this->validateData($inputs)){
$this->returnClientError('Invalid parameters value(s)');
}

// Populate BridgeAbstract::parameters with sanitized data
foreach($param as $name=>$value){
foreach($inputs as $name=>$value){
foreach($this->parameters as $context=>$set){
if(isset($this->parameters[$context][$name])){
$this->parameters[$context][$name]['value']=$value;
Expand Down Expand Up @@ -313,8 +313,8 @@ public function setDatas(array $param){

// Copy global parameter values to the guessed context
foreach($this->parameters['global'] as $name=>$properties){
if(isset($param[$name])){
$value=$param[$name];
if(isset($inputs[$name])){
$value=$inputs[$name];
}else if(isset($properties['value'])){
$value=$properties['value'];
}else{
Expand Down

0 comments on commit 2047955

Please sign in to comment.