public function validate($roles)
{
$this->validateMustBeArray($roles);
// empty arrays are allowed
if (count($roles) === 0) {
return;
}
$this->validateMustBeKeyValuePairs($roles);
}
/** * tell this host what roles it supports * * @param array<string> $roles * a list of the roles that it supports */ public function setRoles($roles) { // make sure we have what we expect $rolesValidator = new TestEnvironment_RolesValidator($this); $rolesValidator->validate($roles); // remember the roles $this->roles = $roles; // all done // fluent interface support return $this; }