Price::getPrice()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 0
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