Test Setup Failed
Push — master ( f402dd...7296e4 )
by Hector Luis
05:56
created

GetPackageHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Application Handler Class
5
 * @package Ticaje_BookingApi
6
 * @author  Hector Luis Barrientos <[email protected]>
7
 */
8
9
namespace Ticaje\BookingApi\Application\UseCase\Handler;
10
11
use Ticaje\Hexagonal\Application\Signatures\Responder\ResponseInterface;
12
use Ticaje\Hexagonal\Application\Signatures\UseCase\HandlerInterface;
13
use Ticaje\Hexagonal\Application\Signatures\UseCase\UseCaseCommandInterface;
14
15
/**
16
 * Class GetPackageHandler
17
 * @package Ticaje\BookingApi\Application\UseCase\Handler
18
 */
19
class GetPackageHandler extends Base implements HandlerInterface
20
{
21
    /**
22
     * @inheritDoc
23
     */
24
    public function handle(UseCaseCommandInterface $command): ResponseInterface
25
    {
26
        $content = $this->serviceProvider->execute($command);
27
        $this->responder
28
            ->setSuccess(true)
29
            ->setMessage('Prices fetched successfully!!')
30
            ->setContent($content);
31
32
        return $this->responder;
33
    }
34
}
35