public function getRole()
    {
        $id = $this->getId();

        if (strpos($id, 'ROLE_') === 0) {
            return strtoupper($id);
        }

        return strtoupper('ROLE_' . $this->getId());
    }
public function getRole()
    {
        $id = $this->getId();

        if (strpos($id, 'ROLE_') === 0) {
            return strtoupper($id);
        }

        return strtoupper('ROLE_' . $this->getId());
    }
public function getRole ( ) { $ id = $ this -> getId ( ) ; if ( strpos ( $ id , 'ROLE_' ) === 0 ) { return strtoupper ( $ id ) ; } return strtoupper ( 'ROLE_' . $ this -> getId ( ) ) ; }
Returns the role.

This method returns a string representation whenever possible.

When the role cannot be represented with sufficient precision by a
string, it should return null.

@return string|null A string representation of the role, or null
Returns the role .