validate() public method

throws an exception if there's anything wrong with the roles
public validate ( mixed $roles ) : void
$roles mixed the roles to validate
return void
Example #1
0
 /**
  * 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;
 }