Bristol SU Support Package
Connector.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
12 abstract class Connector
13 {
14 
20  protected $client;
21 
27  protected $settings = [];
28 
32  public function __construct(Client $client)
33  {
34  $this->client = $client;
35  }
36 
48  abstract public function request($method, $uri, array $options = []);
49 
55  abstract public function test(): bool;
56 
62  abstract static public function settingsSchema(): Form;
63 
69  public function setSettings(array $settings = []) {
70  $this->settings = $settings;
71  }
72 
81  public function getSetting(string $key, $default = null)
82  {
83  if (array_key_exists($key, $this->settings)) {
84  return $this->settings[$key];
85  }
86  return $default;
87  }
88 
89 }
request($method, $uri, array $options=[])
getSetting(string $key, $default=null)
Definition: Connector.php:81