You are here

public function Publisher::setParameter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php \Zend\Feed\PubSubHubbub\Publisher::setParameter()

Add an optional parameter to the update notification requests

Parameters

string $name:

string|null $value:

Return value

Publisher

Throws

Exception\InvalidArgumentException

1 call to Publisher::setParameter()
Publisher::setParameters in vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php
Add an optional parameter to the update notification requests

File

vendor/zendframework/zend-feed/src/PubSubHubbub/Publisher.php, line 278

Class

Publisher

Namespace

Zend\Feed\PubSubHubbub

Code

public function setParameter($name, $value = null) {
  if (is_array($name)) {
    $this
      ->setParameters($name);
    return $this;
  }
  if (empty($name) || !is_string($name)) {
    throw new Exception\InvalidArgumentException('Invalid parameter "name"' . ' of "' . $name . '" must be a non-empty string');
  }
  if ($value === null) {
    $this
      ->removeParameter($name);
    return $this;
  }
  if (empty($value) || !is_string($value) && $value !== null) {
    throw new Exception\InvalidArgumentException('Invalid parameter "value"' . ' of "' . $value . '" must be a non-empty string');
  }
  $this->parameters[$name] = $value;
  return $this;
}