ConnectionBuilder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 12 1
1
<?php
2
3
namespace SquareetLabs\LaravelOpenVidu\Builders;
4
5
use SquareetLabs\LaravelOpenVidu\Connection;
6
7
/**
8
 * Class ConnectionBuilder
9
 * @package SquareetLabs\LaravelOpenVidu\Builders
10
 */
11
class ConnectionBuilder implements BuilderInterface
12
{
13
    /**
14
     * @param  array  $properties
15
     * @param  array|null  $publishers
16
     * @param  array|null  $subscribers
17
     * @return Connection
18
     */
19
    public static function build(array $properties, ?array $publishers = [], ?array $subscribers = [])
20
    {
21
        return new Connection($properties['connectionId'],
22
            $properties['createdAt'],
23
            $properties['role'],
24
            $properties['token'],
25
            $properties['location'],
26
            $properties['platform'],
27
            $properties['serverData'],
28
            $properties['clientData'],
29
            $publishers,
30
            $subscribers
31
        );
32
    }
33
}