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\php\billing\tests\support\tools; |
12
|
|
|
|
13
|
|
|
use hiqdev\php\billing\action\ActionFactory; |
14
|
|
|
use hiqdev\php\billing\customer\CustomerFactory; |
15
|
|
|
use hiqdev\php\billing\plan\PlanFactory; |
16
|
|
|
use hiqdev\php\billing\price\PriceFactory; |
17
|
|
|
use hiqdev\php\billing\price\SinglePrice; |
18
|
|
|
use hiqdev\php\billing\sale\SaleFactory; |
19
|
|
|
use hiqdev\php\billing\target\TargetFactory; |
20
|
|
|
use hiqdev\php\billing\tools\Factory; |
21
|
|
|
use hiqdev\php\billing\type\TypeFactory; |
22
|
|
|
|
23
|
|
|
class SimpleFactory extends Factory |
24
|
|
|
{ |
25
|
|
|
public function __construct(array $factories = []) |
26
|
|
|
{ |
27
|
|
|
return parent::__construct(array_merge(self::simpleFactories(), $factories)); |
|
|
|
|
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public static function simpleFactories(): array |
31
|
|
|
{ |
32
|
|
|
return [ |
33
|
|
|
'action' => new ActionFactory(), |
34
|
|
|
'customer' => new CustomerFactory(), |
35
|
|
|
'plan' => new PlanFactory(), |
36
|
|
|
'price' => new PriceFactory([], SinglePrice::class), |
37
|
|
|
'sale' => new SaleFactory(), |
38
|
|
|
'target' => new TargetFactory(), |
39
|
|
|
'type' => new TypeFactory(), |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|
This check looks for function or method calls that always return null and whose return value is used.
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.