ReturnValueSetter::set()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 4
crap 2
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/js-sandbox PHP library.
5
 *
6
 * Copyright (c) 2016-2017 Bogdan Padalko <[email protected]>
7
 *
8
 * Licensed under the MIT license: http://opensource.org/licenses/MIT
9
 *
10
 * For the full copyright and license information, please view the
11
 * LICENSE file that was distributed with this source or visit
12
 * http://opensource.org/licenses/MIT
13
 */
14
15
16
namespace Pinepain\JsSandbox\Wrappers\FunctionComponents;
17
18
19
use Pinepain\JsSandbox\Specs\FunctionSpecInterface;
20
use Pinepain\JsSandbox\Wrappers\WrapperInterface;
21
use V8\FunctionCallbackInfo;
22
23
24
class ReturnValueSetter implements ReturnValueSetterInterface
25
{
26
    public function set(WrapperInterface $wrapper, FunctionCallbackInfo $args, FunctionSpecInterface $spec, $value)
27
    {
28
        $isolate = $args->getIsolate();
29
        $context = $args->getContext();
30
31
        $return_value = $args->getReturnValue();
32
33
        //$return_spec = $spec->getReturn();
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
34
        // TODO: handle return type
35
36
        $val = $wrapper->wrap($isolate, $context, $value);
37
        $return_value->set($val);
38
    }
39
}
40