コード例 #1
0
ファイル: ClientSpec.php プロジェクト: Owsy/sylius-api-php
 function let(HttpClientInterface $httpClient, PostFileFactoryInterface $postFileFactory)
 {
     $httpClient->getBaseUrl()->willReturn('http://demo.sylius.org/api/');
     $this->beConstructedWith($httpClient, $postFileFactory);
 }
コード例 #2
0
 private function createAuthHttp(ClientInterface $http)
 {
     return new Client(['base_url' => $http->getBaseUrl(), 'defaults' => ['exceptions' => true, 'verify' => $http->getDefaultOption('verify'), 'proxy' => $http->getDefaultOption('proxy')]]);
 }
コード例 #3
0
ファイル: Client.php プロジェクト: Owsy/sylius-api-php
 public function __construct(HttpClientInterface $httpClient, PostFileFactoryInterface $postFileFactory = null)
 {
     $this->httpClient = $httpClient;
     $this->postFileFactory = $postFileFactory ?: new PostFileFactory();
     $this->baseUrl = Url::fromString($httpClient->getBaseUrl());
 }