Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ChannelOptions
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2namespace Ably\Models;
3
4use Ably\Utils\Crypto;
5
6/**
7 * Channel options
8 */
9class ChannelOptions extends BaseOptions {
10
11    /**
12     * @var \Ably\Models\CipherParams|null Parameters of the cipher used on the channel, null if unencrypted
13     */
14    public $cipher = null;
15
16    /**
17     * Transforms `cipher` from array to CipherParams, if necessary
18     */
19    public function __construct( $options = [] ) {
20        parent::__construct( $options );
21        
22        if ( is_array( $this->cipher ) ) {
23            $this->cipher = Crypto::getDefaultParams( $this->cipher );
24        }
25    }
26}