| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | class Billing implements BillingInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var CalculatorInterface |
||
| 26 | */ |
||
| 27 | protected $calculator; |
||
| 28 | /** |
||
| 29 | * @var AggregatorInterface |
||
| 30 | */ |
||
| 31 | protected $aggregator; |
||
| 32 | /** |
||
| 33 | * @var MergerInterface |
||
| 34 | */ |
||
| 35 | protected $merger; |
||
| 36 | /** |
||
| 37 | * @var BillRepositoryInterface |
||
| 38 | */ |
||
| 39 | private $billRepository; |
||
| 40 | |||
| 41 | public function __construct( |
||
| 51 | } |
||
| 52 | |||
| 53 | public function calculate(OrderInterface $order): array |
||
| 54 | { |
||
| 55 | $charges = $this->calculator->calculateOrder($order); |
||
| 56 | $bills = $this->aggregator->aggregateCharges($charges); |
||
| 57 | |||
| 58 | return $this->merger->mergeBills($bills); |
||
| 59 | } |
||
| 60 | |||
| 61 | public function perform(OrderInterface $order): array |
||
| 63 | } |
||
|
|
|||
| 64 | } |
||
| 65 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: