Skip to content

Commit

Permalink
Merge d6d6667 into 7c3b8ee
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Kalkbrenner committed Feb 8, 2019
2 parents 7c3b8ee + d6d6667 commit 324cc5e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 345 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -9,9 +9,9 @@ php:
- nightly

env:
- SYMFONY_VERSION=4.0.* SOLR_VERSION=7.6.0 SOLR_CLOUD=true
- SYMFONY_VERSION=4.0.* SOLR_VERSION=7.6.0 SOLR_CLOUD=false
- SYMFONY_VERSION=4.0.* SOLR_VERSION=6.6.5 SOLR_CLOUD=false
- SYMFONY_VERSION=4.2.* SOLR_VERSION=7.6.0 SOLR_CLOUD=true
- SYMFONY_VERSION=4.2.* SOLR_VERSION=7.6.0 SOLR_CLOUD=false
- SYMFONY_VERSION=4.2.* SOLR_VERSION=6.6.5 SOLR_CLOUD=false
- SYMFONY_VERSION=3.3.* SOLR_VERSION=6.6.5 SOLR_CLOUD=false

cache:
Expand Down Expand Up @@ -49,7 +49,7 @@ script:
fi
after_success:
- travis_retry php vendor/bin/coveralls -v
- travis_retry php vendor/bin/php-coveralls -v

matrix:
allow_failures:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,11 @@ All notable changes to the solarium library will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.3.0-beta.1]
### Changed
- Updated dev and test environments to newer package versions, for example PHPUnit 7.5


## [4.3.0-alpha.2]
### Added
- Basic V2 API support
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -19,9 +19,9 @@
},
"require-dev": {
"guzzlehttp/guzzle": "^3.8 || ^6.2",
"phpunit/phpunit": "^6.5",
"php-coveralls/php-coveralls": "^1.0",
"squizlabs/php_codesniffer": "^1.4",
"phpunit/phpunit": "^7.5",
"php-coveralls/php-coveralls": "^2.1",
"squizlabs/php_codesniffer": "^3.4",
"zendframework/zend-http": "^2.8"
},
"suggest": {
Expand Down
10 changes: 0 additions & 10 deletions src/Core/Client/Adapter/Curl.php
Expand Up @@ -40,7 +40,6 @@ public function execute($request, $endpoint)
*/
public function getResponse($handle, $httpResponse)
{
// @codeCoverageIgnoreStart
if (false !== $httpResponse && null !== $httpResponse) {
$data = $httpResponse;
$info = curl_getinfo($handle);
Expand All @@ -55,7 +54,6 @@ public function getResponse($handle, $httpResponse)
curl_close($handle);

return new Response($data, $headers);
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -71,7 +69,6 @@ public function getResponse($handle, $httpResponse)
*/
public function createHandle($request, $endpoint)
{
// @codeCoverageIgnoreStart
$uri = AdapterHelper::buildUri($request, $endpoint);

$method = $request->getMethod();
Expand Down Expand Up @@ -146,7 +143,6 @@ public function createHandle($request, $endpoint)
}

return $handler;
// @codeCoverageIgnoreEnd
}

/**
Expand Down Expand Up @@ -178,12 +174,10 @@ public function check($data, $headers, $handle)
*/
protected function getData($request, $endpoint)
{
// @codeCoverageIgnoreStart
$handle = $this->createHandle($request, $endpoint);
$httpResponse = curl_exec($handle);

return $this->getResponse($handle, $httpResponse);
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -195,13 +189,11 @@ protected function getData($request, $endpoint)
*/
protected function init()
{
// @codeCoverageIgnoreStart
if (!function_exists('curl_init')) {
throw new RuntimeException('cURL is not available, install it to use the CurlHttp adapter');
}

parent::init();
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -214,7 +206,6 @@ protected function init()
*/
protected function createOptions($request, $endpoint)
{
// @codeCoverageIgnoreStart
$options = [
'timeout' => $endpoint->getTimeout(),
];
Expand All @@ -226,6 +217,5 @@ protected function createOptions($request, $endpoint)
}

return $options;
// @codeCoverageIgnoreEnd
}
}
8 changes: 8 additions & 0 deletions src/Core/Client/Adapter/Guzzle3.php
Expand Up @@ -31,6 +31,7 @@ class Guzzle3 extends Configurable implements AdapterInterface
*/
public function execute($request, $endpoint)
{
// @codeCoverageIgnoreStart
$uri = AdapterHelper::buildUri($request, $endpoint);
$guzzleRequest = $this->getGuzzleClient()->createRequest(
$request->getMethod(),
Expand Down Expand Up @@ -72,6 +73,7 @@ public function execute($request, $endpoint)

throw new HttpException("HTTP request failed, {$error}");
}
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -81,11 +83,13 @@ public function execute($request, $endpoint)
*/
public function getGuzzleClient()
{
// @codeCoverageIgnoreStart
if (null === $this->guzzleClient) {
$this->guzzleClient = new GuzzleClient(null, $this->options);
}

return $this->guzzleClient;
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -97,6 +101,7 @@ public function getGuzzleClient()
*/
private function getRequestBody(Request $request)
{
// @codeCoverageIgnoreStart
if (Request::METHOD_PUT == $request->getMethod()) {
return $request->getRawData();
}
Expand All @@ -111,6 +116,7 @@ private function getRequestBody(Request $request)
}

return $request->getRawData();
// @codeCoverageIgnoreEnd
}

/**
Expand All @@ -123,6 +129,7 @@ private function getRequestBody(Request $request)
*/
private function getRequestHeaders(Request $request)
{
// @codeCoverageIgnoreStart
$headers = [];
foreach ($request->getHeaders() as $headerLine) {
list($header, $value) = explode(':', $headerLine);
Expand All @@ -140,5 +147,6 @@ private function getRequestHeaders(Request $request)
}

return $headers;
// @codeCoverageIgnoreEnd
}
}
2 changes: 0 additions & 2 deletions src/Core/Client/Adapter/Http.php
Expand Up @@ -146,7 +146,6 @@ public function createContext($request, $endpoint)
*/
protected function getData($uri, $context)
{
// @codeCoverageIgnoreStart
$data = @file_get_contents($uri, false, $context);

$headers = [];
Expand All @@ -156,6 +155,5 @@ protected function getData($uri, $context)
}

return [$data, $headers];
// @codeCoverageIgnoreEnd
}
}

0 comments on commit 324cc5e

Please sign in to comment.