SimpleCalculator::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 1
nop 3
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\billing\hiapi\tests\support\order;
12
13
use hiqdev\billing\hiapi\charge\Generalizer;
14
use hiqdev\php\billing\charge\GeneralizerInterface;
15
use hiqdev\billing\hiapi\type\TypeSemantics;
16
17
class SimpleCalculator extends \hiqdev\php\billing\tests\support\order\SimpleCalculator
18
{
19
    public function __construct(GeneralizerInterface $generalizer = null, $sale = null, $plan = null)
20
    {
21
        $generalizer = $generalizer ?: new Generalizer(new TypeSemantics());
22
23
        return parent::__construct($generalizer, $sale, $plan);
0 ignored issues
show
Bug introduced by
Are you sure the usage of parent::__construct($generalizer, $sale, $plan) targeting hiqdev\php\billing\tests...lculator::__construct() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
24
    }
25
}
26