Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Cp7 m510 centreon awie (fixes) (#6313)
Browse files Browse the repository at this point in the history
* fix(global): PHP 7 compatability, deprecated function, PHP notices

replace using of deprecated each() function with foreach(),
fix several PHP notices related with undefined index
fix PHP notices related to undefined index and fix CentreonObject::add compatibility with child objects
set NULL in lower case

Resolves CP7M-51
  • Loading branch information
vhr authored and kduret committed Jun 5, 2018
1 parent 0448e94 commit 926d3bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions www/class/centreon-clapi/centreonObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,10 @@ protected function checkParameters()
/**
* Add Action
*
* @param mixed $parameters
* @return int
*/
public function add()
public function add($parameters = NULL)
{
$id = $this->object->insert($this->params);
$this->addAuditLog(
Expand Down Expand Up @@ -347,9 +348,10 @@ public function setparam($objectId, $params = array())
* Shows list
*
* @param array $params
* @param array $filters
* @return void
*/
public function show($params = array(), $filters = array())
public function show(array $params = null, array $filters = null)
{
echo str_replace("_", " ", implode($this->delim, $params)) . "\n";
$elements = $this->object->getList($params, -1, 0, null, null, $filters);
Expand Down
3 changes: 3 additions & 0 deletions www/class/centreon-clapi/centreonServiceTemplate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ public function setmacro($parameters)
if (count($params) < 3) {
throw new CentreonClapiException(self::MISSINGPARAMETER);
}

$params[3] = isset($params[3]) ? $params[3] : null;

$elements = $this->object->getList(
"service_id",
-1,
Expand Down

0 comments on commit 926d3bb

Please sign in to comment.