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;
    }
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;
    }
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 ; }
Utility method to create a Principal for the given username. This
creates an instance of the principalClassName type if this option was
specified. If principalClassName was not specified, a SimplePrincipal
is created.

@param \AppserverIo\Lang\String $name The name of the principal

@return \AppserverIo\Psr\Security\PrincipalInterface The principal instance
@throws \Exception Is thrown if the custom principal type cannot be created
Utility method to create a Principal for the given username . This creates an instance of the principalClassName type if this option was specified . If principalClassName was not specified a SimplePrincipal is created .