public function createIdentity(string $name) { //initialize the principal $principal = null; // query whether or not a principal class name has been specified if ($this->principalClassName == null) { $principal = new SimplePrincipal($name); } else { $reflectionClass = new ReflectionClass($this->principalClassName->__toString()); $principal = $reflectionClass->newInstanceArgs(array($name)); } // return the principal instance return $principal; }