Command: Rename getParameters to getArguments

refs #4580
This commit is contained in:
Eric Lippmann 2013-09-16 14:46:18 +02:00
parent a47db3497e
commit 8baa2dec54
9 changed files with 36 additions and 36 deletions

View File

@ -116,7 +116,7 @@ abstract class Command
*
* @return array
*/
abstract public function getParameters();
abstract public function getArguments();
/**
* Return the command as a string with the given host being inserted

View File

@ -74,7 +74,7 @@ class Comment
* @param bool $ignorePersistentFlag Whether the persistent flag should be included or not
* @return array
*/
public function getParameters($ignorePersistentFlag = false)
public function getArguments($ignorePersistentFlag = false)
{
if ($ignorePersistentFlag) {
return array($this->author, $this->content);

View File

@ -136,16 +136,16 @@ class AcknowledgeCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
$parameters = array_merge(
array(
$this->sticky ? '2' : '0',
$this->notify ? '1' : '0'
),
$this->comment->getParameters()
$this->comment->getArguments()
);
if ($this->expireTime > -1) {
@ -165,7 +165,7 @@ class AcknowledgeCommand extends Command
*/
public function getHostCommand($hostname)
{
$parameters = $this->getParameters();
$parameters = $this->getArguments();
return sprintf('ACKNOWLEDGE_HOST_PROBLEM%s;', $this->expireTime > -1 ? '_EXPIRE' : '')
. implode(';', array_merge(array($hostname), $parameters));
}
@ -181,7 +181,7 @@ class AcknowledgeCommand extends Command
*/
public function getServiceCommand($hostname, $servicename)
{
$parameters = $this->getParameters();
$parameters = $this->getArguments();
return sprintf('ACKNOWLEDGE_SVC_PROBLEM%s;', $this->expireTime > -1 ? '_EXPIRE' : '')
. implode(';', array_merge(array($hostname, $servicename), $parameters));
}

View File

@ -68,9 +68,9 @@ class AddCommentCommand extends Command
return $this;
}
public function getParameters()
public function getArguments()
{
return $this->comment->getParameters();
return $this->comment->getArguments();
}
/**
@ -83,7 +83,7 @@ class AddCommentCommand extends Command
*/
public function getHostCommand($hostname)
{
return sprintf('ADD_HOST_COMMENT;%s;', $hostname) . implode(';', $this->getParameters());
return sprintf('ADD_HOST_COMMENT;%s;', $hostname) . implode(';', $this->getArguments());
}
/**
@ -98,6 +98,6 @@ class AddCommentCommand extends Command
public function getServiceCommand($hostname, $servicename)
{
return sprintf('ADD_SVC_COMMENT;%s;%s;', $hostname, $servicename)
. implode(';', $this->getParameters());
. implode(';', $this->getArguments());
}
}

View File

@ -114,9 +114,9 @@ class CustomNotificationCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
$options = 0;
if ($this->forced) {
@ -125,7 +125,7 @@ class CustomNotificationCommand extends Command
if ($this->broadcast) {
$options |= 1;
}
return array_merge(array($options), $this->comment->getParameters(true));
return array_merge(array($options), $this->comment->getArguments(true));
}
/**
@ -138,7 +138,7 @@ class CustomNotificationCommand extends Command
*/
public function getHostCommand($hostname)
{
return 'SEND_CUSTOM_HOST_NOTIFICATION;' . implode(';', array_merge(array($hostname), $this->getParameters()));
return 'SEND_CUSTOM_HOST_NOTIFICATION;' . implode(';', array_merge(array($hostname), $this->getArguments()));
}
/**
@ -156,7 +156,7 @@ class CustomNotificationCommand extends Command
';',
array_merge(
array($hostname, $servicename),
$this->getParameters()
$this->getArguments()
)
);
}

View File

@ -69,9 +69,9 @@ class DelayNotificationCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
return array($this->delay);
}
@ -86,7 +86,7 @@ class DelayNotificationCommand extends Command
*/
public function getHostCommand($hostname)
{
return 'DELAY_HOST_NOTIFICATION;' . implode(';', array_merge(array($hostname), $this->getParameters()));
return 'DELAY_HOST_NOTIFICATION;' . implode(';', array_merge(array($hostname), $this->getArguments()));
}
/**
@ -104,7 +104,7 @@ class DelayNotificationCommand extends Command
';',
array_merge(
array($hostname, $servicename),
$this->getParameters()
$this->getArguments()
)
);
}

View File

@ -91,9 +91,9 @@ class ScheduleCheckCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
return array($this->checkTime);
}
@ -112,7 +112,7 @@ class ScheduleCheckCommand extends Command
'SCHEDULE%s_HOST_%s;',
$this->forced ? '_FORCED' : '',
$this->onlyServices ? 'SVC_CHECKS' : 'CHECK'
) . implode(';', array_merge(array($hostname), $this->getParameters()));
) . implode(';', array_merge(array($hostname), $this->getArguments()));
}
/**
@ -127,6 +127,6 @@ class ScheduleCheckCommand extends Command
public function getServiceCommand($hostname, $servicename)
{
return sprintf('SCHEDULE%s_SVC_CHECK;', $this->forced ? '_FORCED' : '')
. implode(';', array_merge(array($hostname, $servicename), $this->getParameters()));
. implode(';', array_merge(array($hostname, $servicename), $this->getArguments()));
}
}

View File

@ -200,9 +200,9 @@ class ScheduleDowntimeCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
return array_merge(
array(
@ -212,7 +212,7 @@ class ScheduleDowntimeCommand extends Command
$this->triggerId,
$this->duration
),
$this->comment->getParameters(true)
$this->comment->getArguments(true)
);
}
@ -227,10 +227,10 @@ class ScheduleDowntimeCommand extends Command
{
if ($this->withChildren) {
return sprintf('SCHEDULE_AND_PROPAGATE%s_HOST_DOWNTIME;', $this->triggerChildren ? '_TRIGGERED' : '')
. implode(';', array_merge(array($hostname), $this->getParameters()));
. implode(';', array_merge(array($hostname), $this->getArguments()));
} else {
return sprintf('SCHEDULE_HOST%s_DOWNTIME;', $this->onlyServices ? '_SVC' : '')
. implode(';', array_merge(array($hostname), $this->getParameters()));
. implode(';', array_merge(array($hostname), $this->getArguments()));
}
}
@ -248,7 +248,7 @@ class ScheduleDowntimeCommand extends Command
';',
array_merge(
array($hostname, $servicename),
$this->getParameters()
$this->getArguments()
)
);
}
@ -263,7 +263,7 @@ class ScheduleDowntimeCommand extends Command
public function getHostgroupCommand($hostgroup)
{
return sprintf('SCHEDULE_HOSTGROUP_%s_DOWNTIME;', $this->withoutHosts ? 'SVC' : 'HOST')
. implode(';', array_merge(array($hostgroup), $this->getParameters()));
. implode(';', array_merge(array($hostgroup), $this->getArguments()));
}
/**
@ -276,6 +276,6 @@ class ScheduleDowntimeCommand extends Command
public function getServicegroupCommand($servicegroup)
{
return sprintf('SCHEDULE_SERVICEGROUP_%s_DOWNTIME;', $this->withoutServices ? 'HOST' : 'SVC')
. implode(';', array_merge(array($servicegroup), $this->getParameters()));
. implode(';', array_merge(array($servicegroup), $this->getArguments()));
}
}

View File

@ -112,9 +112,9 @@ class SubmitPassiveCheckresultCommand extends Command
* Return this command's parameters properly arranged in an array
*
* @return array
* @see Command::getParameters()
* @see Command::getArguments()
*/
public function getParameters()
public function getArguments()
{
return array(
$this->state,
@ -132,7 +132,7 @@ class SubmitPassiveCheckresultCommand extends Command
*/
public function getHostCommand($hostname)
{
return 'PROCESS_HOST_CHECK_RESULT;' . implode(';', array_merge(array($hostname), $this->getParameters()));
return 'PROCESS_HOST_CHECK_RESULT;' . implode(';', array_merge(array($hostname), $this->getArguments()));
}
/**
@ -150,7 +150,7 @@ class SubmitPassiveCheckresultCommand extends Command
';',
array_merge(
array($hostname, $servicename),
$this->getParameters()
$this->getArguments()
)
);
}