Completed
Push — Lonja/albertg ( 67863a...bda4e5 )
by Albert
07:39 queued 05:26
created

LoadCostsByDistance::applyCosts()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 5
crap 1
1
<?php
2
3
namespace Kata\Lonja\Domain\Service\Costs;
4
5
use Kata\Lonja\Domain\Model\Destination;
6
use Kata\Lonja\Domain\Model\Load;
7
8
final class LoadCostsByDistance extends LoadCostsDecorator
9
{
10 1
    protected function applyCosts(Load $a_load, Destination $a_destination, array $some_price_rules, float $net_benefits, float $previous_costs = 0): float
11
    {
12 1
        $truck_load_costs = 5;
13
14 1
        return $truck_load_costs + ($a_destination->kilometers() * 2);
15
    }
16
}