Issues (42)

src/Response/ResponseInterface.php (2 issues)

1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: siim
5
 * Date: 17.01.19
6
 * Time: 8:05
7
 */
8
9
namespace Sf4\Api\Response;
10
11
use Sf4\Api\Dto\DtoInterface;
12
use Sf4\Api\Dto\Traits\DtoTraitInterface;
13
use Sf4\Api\Request\RequestTraitInterface;
14
use Sf4\Api\RequestHandler\RequestHandlerInterface;
15
use Sf4\Api\Utils\Traits\TranslatorTraitInterface;
16
use Symfony\Component\HttpFoundation\JsonResponse;
17
18
interface ResponseInterface extends DtoTraitInterface, RequestTraitInterface, TranslatorTraitInterface
19
{
20
    public const HEADERS = [
21
        'accept' => 'application/json',
22
        'Content-Type' => 'application/json'
23
    ];
24
25
    /**
26
     * @return JsonResponse
27
     */
28
    public function getJsonResponse(): JsonResponse;
29
30
    /**
31
     * @return DtoInterface
32
     */
33
    public function getResponseDto(): DtoInterface;
34
35
    /**
36
     * @param DtoInterface $data
37
     */
38
    public function setResponseDto(DtoInterface $data): void;
39
40
    /**
41
     * @return int
42
     */
43
    public function getResponseStatus(): int;
44
45
    /**
46
     * @param int $status
47
     */
48
    public function setResponseStatus($status): void;
49
50
    /**
51
     * @return array
52
     */
53
    public function getResponseHeaders(): array;
54
55
    /**
56
     * @param array $headers
57
     */
58
    public function setResponseHeaders(array $headers): void;
59
60
    public function init();
61
62
    /**
63
     * @param $id
64
     * @param array $parameters
65
     * @param null $domain
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $domain is correct as it would always require null to be passed?
Loading history...
66
     * @param null $locale
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $locale is correct as it would always require null to be passed?
Loading history...
67
     * @return string
68
     */
69
    public function translate($id, array $parameters = array(), $domain = null, $locale = null): string;
70
71
    /**
72
     * @param JsonResponse $jsonResponse
73
     */
74
    public function setJsonResponse(JsonResponse $jsonResponse);
75
76
    /**
77
     * @return RequestHandlerInterface|null
78
     */
79
    public function getRequestHandler(): ?RequestHandlerInterface;
80
}
81