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

PublisherBuilder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 11 1
1
<?php
2
namespace SquareetLabs\LaravelOpenVidu\Builders;
3
use SquareetLabs\LaravelOpenVidu\Publisher;
4
5
class PublisherBuilder
6
{
7
    /**
8
     * @param array $properties
9
     * @return Publisher
10
     */
11
    public static function build(array $properties)
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

11
    public static function build(/** @scrutinizer ignore-unused */ array $properties)

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...
12
    {
13
        return new Publisher($publishedArray['streamId'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['streamId'] ?? null can also be of type null; however, parameter $streamId of SquareetLabs\LaravelOpen...ublisher::__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

13
        return new Publisher(/** @scrutinizer ignore-type */ $publishedArray['streamId'] ?? null,
Loading history...
Comprehensibility Best Practice introduced by
The variable $publishedArray seems to never exist and therefore isset should always be false.
Loading history...
14
            $publishedArray['createdAt'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['createdAt'] ?? null can also be of type null; however, parameter $createdAt of SquareetLabs\LaravelOpen...ublisher::__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

14
            /** @scrutinizer ignore-type */ $publishedArray['createdAt'] ?? null,
Loading history...
15
            $publishedArray['hasAudio'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['hasAudio'] ?? null can also be of type null; however, parameter $hasAudio of SquareetLabs\LaravelOpen...ublisher::__construct() does only seem to accept boolean, 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

15
            /** @scrutinizer ignore-type */ $publishedArray['hasAudio'] ?? null,
Loading history...
16
            $publishedArray['hasVideo'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['hasVideo'] ?? null can also be of type null; however, parameter $hasVideo of SquareetLabs\LaravelOpen...ublisher::__construct() does only seem to accept boolean, 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

16
            /** @scrutinizer ignore-type */ $publishedArray['hasVideo'] ?? null,
Loading history...
17
            $publishedArray['audioActive'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['audioActive'] ?? null can also be of type null; however, parameter $audioActive of SquareetLabs\LaravelOpen...ublisher::__construct() does only seem to accept boolean, 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

17
            /** @scrutinizer ignore-type */ $publishedArray['audioActive'] ?? null,
Loading history...
18
            $publishedArray['videoActive'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['videoActive'] ?? null can also be of type null; however, parameter $videoActive of SquareetLabs\LaravelOpen...ublisher::__construct() does only seem to accept boolean, 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

18
            /** @scrutinizer ignore-type */ $publishedArray['videoActive'] ?? null,
Loading history...
19
            $publishedArray['frameRate'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['frameRate'] ?? null can also be of type null; however, parameter $frameRate of SquareetLabs\LaravelOpen...ublisher::__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

19
            /** @scrutinizer ignore-type */ $publishedArray['frameRate'] ?? null,
Loading history...
20
            $publishedArray['typeOfVideo'] ?? null,
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['typeOfVideo'] ?? null can also be of type null; however, parameter $typeOfVideo of SquareetLabs\LaravelOpen...ublisher::__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

20
            /** @scrutinizer ignore-type */ $publishedArray['typeOfVideo'] ?? null,
Loading history...
21
            $publishedArray['videoDimensions'] ?? null
0 ignored issues
show
Bug introduced by
It seems like $publishedArray['videoDimensions'] ?? null can also be of type null; however, parameter $videoDimensions of SquareetLabs\LaravelOpen...ublisher::__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

21
            /** @scrutinizer ignore-type */ $publishedArray['videoDimensions'] ?? null
Loading history...
22
        );
23
    }
24
}