Passed
Push — master ( 77f1b4...a6165e )
by Jacobo
03:07
created

ConnectionBuilder::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
nc 1
nop 3
dl 0
loc 12
rs 9.9332
c 1
b 0
f 0
1
<?php
2
/**
3
 * Created by theQuizProject <https://www.thequizproject.com>
4
 * Developer: Jacobo Cantorna Cigarrán <https://es.linkedin.com/in/jacobocantornacigarran>
5
 * Date: 20/12/2019
6
 * Time: 20:50
7
 */
8
9
namespace SquareetLabs\LaravelOpenVidu\Builders;
10
11
12
use SquareetLabs\LaravelOpenVidu\Connection;
13
14
class ConnectionBuilder
15
{
16
    /**
17
     * @param array $properties
18
     * @param array $publishers
19
     * @param array $subscribers
20
     * @return Connection
21
     */
22
    public static function build(array $properties, ?array $publishers = [], ?array $subscribers = [])
0 ignored issues
show
Unused Code introduced by
The parameter $properties is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

22
    public static function build(/** @scrutinizer ignore-unused */ array $properties, ?array $publishers = [], ?array $subscribers = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
    {
24
        return new Connection($connectionArray['connectionId'] ?? null,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $connectionArray seems to never exist and therefore isset should always be false.
Loading history...
Bug introduced by
It seems like $connectionArray['connectionId'] ?? null can also be of type null; however, parameter $connectionId of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        return new Connection(/** @scrutinizer ignore-type */ $connectionArray['connectionId'] ?? null,
Loading history...
25
            $connectionArray['createdAt'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['createdAt'] ?? null can also be of type null; however, parameter $createdAt of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

25
            /** @scrutinizer ignore-type */ $connectionArray['createdAt'] ?? null,
Loading history...
26
            $connectionArray['role'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['role'] ?? null can also be of type null; however, parameter $role of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

26
            /** @scrutinizer ignore-type */ $connectionArray['role'] ?? null,
Loading history...
27
            $connectionArray['token'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['token'] ?? null can also be of type null; however, parameter $token of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
            /** @scrutinizer ignore-type */ $connectionArray['token'] ?? null,
Loading history...
28
            $connectionArray['location'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['location'] ?? null can also be of type null; however, parameter $location of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
            /** @scrutinizer ignore-type */ $connectionArray['location'] ?? null,
Loading history...
29
            $connectionArray['platform'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['platform'] ?? null can also be of type null; however, parameter $platform of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
            /** @scrutinizer ignore-type */ $connectionArray['platform'] ?? null,
Loading history...
30
            $connectionArray['serverData'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['serverData'] ?? null can also be of type null; however, parameter $serverData of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

30
            /** @scrutinizer ignore-type */ $connectionArray['serverData'] ?? null,
Loading history...
31
            $connectionArray['clientData'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $connectionArray['clientData'] ?? null can also be of type null; however, parameter $clientData of SquareetLabs\LaravelOpen...nnection::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
            /** @scrutinizer ignore-type */ $connectionArray['clientData'] ?? null,
Loading history...
32
            $publishers,
33
            $subscribers
34
        );
35
    }
36
}