Airship\Engine\Continuum\Channel::__construct PHP Method

__construct() public method

Channel constructor.
public __construct ( object $parent, string $name, array $config = [] )
$parent object (Continuum or Keyggdrasil)
$name string
$config array
    public function __construct($parent, string $name, array $config = [])
    {
        if ($parent instanceof Keyggdrasil || $parent instanceof Continuum) {
            $this->parent = $parent;
        }
        if (!\is1DArray($config['urls'])) {
            throw new \TypeError(\trk('errors.type.expected_1d_array'));
        }
        // The channel should be signing responses at the application layer:
        $this->publicKey = new SignaturePublicKey(\Sodium\hex2bin($config['publickey']));
        $this->name = $name;
        foreach (\array_values($config['urls']) as $index => $url) {
            if (!\is_string($url)) {
                throw new \TypeError(\trk('errors.type.expected_string_array', \gettype($url), $index));
            }
            $this->urls[] = $url;
        }
    }