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

Commit

Permalink
feat: Added default server address
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Apr 15, 2019
1 parent f69e1c3 commit 4280845
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Joserick/Plex/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
*/
class Plex_Server extends Plex_MachineAbstract
{
/**
* The default address on which a Plex server listens.
*/
const DEFAULT_ADDRESS = 'localhost';

/**
* The default port on which a Plex server listens.
*/
Expand All @@ -62,14 +67,15 @@ class Plex_Server extends Plex_MachineAbstract
* @uses Plex_MachineAbstract::$name
* @uses Plex_MachineAbstract::$address
* @uses Plex_MachineAbstract::$port
* @uses Plex_Server::DEFAULT_ADDRESS
* @uses Plex_Server::DEFAULT_PORT
*
* @return void
*/
public function __construct($name, $address, $port, $token)
{
$this->name = $name;
$this->address = $address;
$this->address = $address ? $address : self::DEFAULT_ADDRESS;
$this->port = $port ? $port : self::DEFAULT_PORT;
$this->token = $token;
}
Expand Down

0 comments on commit 4280845

Please sign in to comment.