You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
751 B
32 lines
751 B
<?php
|
|
|
|
namespace Darksparrow\DeegraphInteractions\DataStructures;
|
|
|
|
class KeyValuePair
|
|
{
|
|
public string $Key;
|
|
public ?string $Value;
|
|
|
|
public function __construct(string $key, ?string $value)
|
|
{
|
|
$this->Key = $key;
|
|
$this->Value = $value;
|
|
}
|
|
|
|
public function __toString(): string
|
|
{
|
|
if(isset($this->Key) && isset($this->Value))
|
|
return "{$this->Key} => \"{$this->Value}\"";
|
|
|
|
if(!isset($this->Key) && isset($this->Value))
|
|
return "NULL => \"{$this->Value}\"";
|
|
|
|
if(isset($this->Key) && !isset($this->Value))
|
|
return "{$this->Key} => NULL";
|
|
|
|
if(isset($this->Key) && isset($this->Value))
|
|
return "NULL => NULL";
|
|
|
|
return "FAIL";
|
|
}
|
|
}
|