Browse Source

more defaults for the `DeegraphServer` constructor

pull/1/head
Cerys Lewis 6 months ago
parent
commit
0f7c31a018
  1. 13
      src/Core/DeegraphServer.php

13
src/Core/DeegraphServer.php

@ -3,7 +3,8 @@
namespace Darksparrow\DeegraphPHP\Core; namespace Darksparrow\DeegraphPHP\Core;
use Darksparrow\DeegraphPHP\DataStructures\ServerInfo; use Darksparrow\DeegraphPHP\DataStructures\ServerInfo;
use Darksparrow\DeegraphPHP\QueryBuilder\QueryBuilders\Put; use Darksparrow\DeegraphPHP\QueryBuilder\QueryBuilders\InsertQuery;
use Darksparrow\DeegraphPHP\QueryBuilder\QueryBuilders\PutQuery;
class DeegraphServer class DeegraphServer
{ {
@ -12,7 +13,11 @@ class DeegraphServer
private string $Token; private string $Token;
private bool $AllowSelfSignedCerts; private bool $AllowSelfSignedCerts;
public function __construct(string $server, int $port, string $token, bool $allowSelfSignedCerts = false) public function __construct(
string $token,
string $server = "localhost",
int $port = 8088,
bool $allowSelfSignedCerts = false)
{ {
$this->ServerDomain = $server; $this->ServerDomain = $server;
$this->Port = $port; $this->Port = $port;
@ -62,10 +67,10 @@ class DeegraphServer
} }
/** /**
* @param Put $query Takes in a Query Builder object. * @param PutQuery|InsertQuery $query Takes in a Query Builder object.
* @return void * @return void
*/ */
public function RunQuery(Put $query): void public function RunQuery(PutQuery|InsertQuery $query): void
{ {
echo $query; echo $query;
echo "<br><br><br>"; echo "<br><br><br>";

Loading…
Cancel
Save