DataSift\Storyplayer\DefinitionLib\TestEnvironment_HostIdValidator::validate PHP Method

validate() public method

make sure that we're happy with a hostId
public validate ( mixed $hostId ) : void
$hostId mixed the hostId to check
return void
    public function validate($hostId)
    {
        $this->validateMustBeString($hostId);
    }

Usage Example

 /**
  * start the definition of a host in this group
  *
  * @param string $hostId
  *        the ID of this host
  * @param HostAdapter $hostAdapter
  *        the plugin for this kind of host
  * @return TestEnvironment_HostDefinition
  *         the empty host definition, for you to complete
  */
 public function newHost($hostId, HostAdapter $hostAdapter)
 {
     // make sure we're happy with the hostId
     $hostIdValidator = new TestEnvironment_HostIdValidator($this);
     $hostIdValidator->validate($hostId);
     // create the new host and send it back
     $this->hosts[$hostId] = $hostAdapter->newHostDefinition($this, $hostId);
     $this->hosts[$hostId]->setHostAdapter($hostAdapter);
     return $this->hosts[$hostId];
 }
TestEnvironment_HostIdValidator