Phue\Client::getUsername PHP Method

getUsername() public method

Get username
public getUsername ( ) : string
return string Username
    public function getUsername()
    {
        return $this->username;
    }

Usage Example

コード例 #1
0
ファイル: IsAuthorized.php プロジェクト: bendspoons/Phue
 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return bool True if authorized, false if not
  */
 public function send(Client $client)
 {
     // Get response
     try {
         $client->getTransport()->sendRequest("/api/{$client->getUsername()}");
     } catch (UnauthorizedUserException $e) {
         return false;
     }
     return true;
 }
All Usage Examples Of Phue\Client::getUsername