1 | <?php declare(strict_types=1); |
||
14 | final class ApiSettings |
||
15 | { |
||
16 | const NAMESPACE = 'Vendor\\Project\\Resource'; |
||
17 | |||
18 | const TRANSPORT_OPTIONS = [ |
||
19 | FoundationOptions::HYDRATOR_OPTIONS => [ |
||
20 | HydratorOptions::NAMESPACE => self::NAMESPACE, |
||
21 | HydratorOptions::NAMESPACE_DIR => __DIR__ . DIRECTORY_SEPARATOR . 'Resource' . DIRECTORY_SEPARATOR, |
||
22 | ], |
||
23 | FoundationOptions::TRANSPORT_OPTIONS => [ |
||
24 | TransportOptions::HOST => 'api.example.com', |
||
25 | TransportOptions::MIDDLEWARE => [ |
||
26 | HttpExceptionsMiddleware::class, |
||
27 | UserAgentMiddleware::class, |
||
28 | ], |
||
29 | TransportOptions::DEFAULT_REQUEST_OPTIONS => [ |
||
30 | UserAgentMiddleware::class => [ |
||
31 | UserAgentMiddlewareOptions::STRATEGY => UserAgentStrategies::PACKAGE_VERSION, |
||
32 | UserAgentMiddlewareOptions::PACKAGE => 'vendor/package', |
||
33 | ], |
||
34 | ], |
||
35 | ], |
||
36 | ]; |
||
37 | |||
38 | 1 | public static function getOptions( |
|
47 | } |
||
48 |