Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ChannelOptions | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |
0.00% |
0 / 1 |
| __construct | |
66.67% |
2 / 3 |
|
0.00% |
0 / 1 |
2.15 | |||
| 1 | <?php |
| 2 | namespace Ably\Models; |
| 3 | |
| 4 | use Ably\Utils\Crypto; |
| 5 | |
| 6 | /** |
| 7 | * Channel options |
| 8 | */ |
| 9 | class 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 | } |