Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
feat: Added utilization of token
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Apr 12, 2019
1 parent f63439c commit 479deef
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Joserick/Plex/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author <[email protected]> Nick Bartkowiak
* @copyright (c) 2012 Nick Bartkowiak
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public Licence (GPLv3)
* @version 0.0.1
* @version 0.0.2
*/
class Plex_Client extends Plex_MachineAbstract
{
Expand Down Expand Up @@ -72,19 +72,22 @@ class Plex_Client extends Plex_MachineAbstract
* @param string $name The name of the Plex client.
* @param string $address The IP address of the Plex client.
* @param integer $port The port on which the Plex client is listening.
* @param string $token The token of the Plex client.
*
* @uses Plex_MachineAbstract::$name
* @uses Plex_MachineAbstract::$address
* @uses Plex_MachineAbstract::$port
* @uses Plex_MachineAbstract::$token
* @uses Plex_Client::DEFAULT_PORT
*
* @return void
*/
public function __construct($name, $address, $port)
public function __construct($name, $address, $port, $token)
{
$this->name = $name;
$this->address = $address;
$this->port = $port ? $port : self::DEFAULT_PORT;
$this->token = $token;
}

/**
Expand All @@ -107,6 +110,7 @@ private function getController($type)
$this->name,
$this->address,
$this->port,
$this->token,
$this->getServer()
);
}
Expand Down Expand Up @@ -192,6 +196,16 @@ public function getPort()
return $this->port;
}

/**
* Returns the token on which the Plex machine listens.
*
* @return string|null The token on which the Plex machine listens.
*/
public function getToken()
{
return $this->token;
}

/**
* Returns the hostname of the Plex client.
*
Expand Down

0 comments on commit 479deef

Please sign in to comment.