Price   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 12
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPrice() 0 7 1
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Application Service Class
5
 * @package     Ticaje_BookingApi
6
 * @author      Hector Luis Barrientos <[email protected]>
7
 */
8
9
namespace Ticaje\BookingApi\Application\Service\Provider\HotelRoom;
10
11
use Ticaje\BookingApi\Application\Service\Provider\BasePriceProvider;
12
use Ticaje\BookingApi\Application\Signatures\Provider\PriceProviderSignature;
13
use Ticaje\Hexagonal\Application\Signatures\UseCase\UseCaseCommandInterface;
14
15
/**
16
 * Class Price
17
 * @package Ticaje\BookingApi\Application\Service\Provider\HotelRoom
18
 */
19
class Price extends BasePriceProvider implements PriceProviderSignature
20
{
21
    /**
22
     * @inheritDoc
23
     */
24
    public function getPrice(UseCaseCommandInterface $command): float
25
    {
26
        $days = $this->calculateDays($command);
27
        $price = $this->instance->getPrice();
0 ignored issues
show
Bug introduced by
The method getPrice() does not exist on Ticaje\Contract\Persistence\Entity\EntityInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        /** @scrutinizer ignore-call */ 
28
        $price = $this->instance->getPrice();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        $price *= (int)$days->days;
29
30
        return (float)$price;
31
    }
32
}
33