GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

JsonEncodeOperator::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 12
loc 12
ccs 6
cts 6
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Rx\Operator;
4
5
use Rx\DisposableInterface;
6
use Rx\ObservableInterface;
7
use Rx\ObserverInterface;
8
use Rx\Operator\OperatorInterface;
9
10 View Code Duplication
final class JsonEncodeOperator implements OperatorInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @inheritDoc
14
     */
15 2
    public function __invoke(
16
        ObservableInterface $observable,
17
        ObserverInterface $observer
18
    ): DisposableInterface {
19 2
        return $observable->subscribe(
20
            function (array $json) use ($observer): void {
21 1
                $observer->onNext(\json_encode($json));
22 2
            },
23 2
            [$observer, 'onError'],
24 2
            [$observer, 'onCompleted']
25
        );
26
    }
27
}
28