diff --git a/.github/workflows/.editorconfig b/.github/workflows/.editorconfig new file mode 100644 index 0000000..7bd3346 --- /dev/null +++ b/.github/workflows/.editorconfig @@ -0,0 +1,2 @@ +[*.yml] +indent_size = 2 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..85418d3 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,19 @@ +name: Checks + +on: + push: + branches: + - master + pull_request: + +jobs: + roave-bc-check: + name: Roave BC Check + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Roave BC Check + uses: "docker://nyholm/roave-bc-check-ga" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6d77518 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + latest: + name: PHP ${{ matrix.php }} Latest + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.1', '7.2', '7.3', '7.4', '8.0'] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: none + + - name: Install PHP 7 dependencies + run: composer update --prefer-dist --no-interaction --no-progress + if: "startsWith(matrix.php, '7.')" + + - name: Install PHP 8 dependencies + run: | + composer require "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update + composer update --prefer-dist --prefer-stable --no-interaction --no-progress --ignore-platform-req=php + if: "startsWith(matrix.php, '8.')" + + - name: Execute tests + run: composer test + + lowest: + name: PHP ${{ matrix.php }} Lowest + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.1', '7.4'] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v1 + coverage: none + + - name: Install dependencies + run: | + wget https://github.com/puli/cli/releases/download/1.0.0-beta9/puli.phar && chmod +x puli.phar + composer require "sebastian/comparator:^3.0.2" "puli/composer-plugin:1.0.0-beta9" --no-interaction --no-update + composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress + + - name: Execute tests + run: composer test + + coverage: + name: Code Coverage + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer:v2 + coverage: xdebug + + - name: Install dependencies + run: | + composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update + composer update --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: composer test-ci + + - name: Upload coverage + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml new file mode 100644 index 0000000..c686136 --- /dev/null +++ b/.github/workflows/installation.yml @@ -0,0 +1,94 @@ +name: Installation +on: + push: + branches: + - master + pull_request: + +jobs: + installation: + name: Installation test ${{ matrix.expect }} ${{ matrix.method }} ${{ matrix.requirements }} ${{ matrix.pecl }} + runs-on: ubuntu-latest + + strategy: + matrix: + include: + # Test that we find Guzzle 6 v1 + - expect: will-find + requirements: "php-http/guzzle6-adapter:^1.1.1" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # Test that we find Guzzle 6 v2 + - expect: will-find + requirements: "php-http/guzzle6-adapter:^2.0.1" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # Test that we find Guzzle 7 Adapter + - expect: will-find + requirements: "php-http/guzzle7-adapter:^0.1" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # Test that we find a client with Symfony and Guzzle PSR-7 + - expect: will-find + requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1 http-interop/http-factory-guzzle" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # We should fail if we dont have php-http/message-factory or PSR-17 + - expect: cant-find + requirements: "symfony/http-client:^5 php-http/httplug php-http/message-factory guzzlehttp/psr7:^1" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + - expect: cant-find + requirements: "symfony/http-client:^5 php-http/httplug guzzlehttp/psr7:^1 http-interop/http-factory-guzzle" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed + - expect: will-find + requirements: "symfony/http-client:^5 php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:^1" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # Test that we find a client with Symfony and Guzzle + - expect: will-find + requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter" + method: "Http\\Discovery\\HttpClientDiscovery::find();" + # Test that we find an async client with Symfony and Guzzle + - expect: will-find + requirements: "php-http/client-common:^2 php-http/message:^1.8 symfony/http-client:^4 php-http/guzzle6-adapter" + method: "Http\\Discovery\\HttpAsyncClientDiscovery::find();" + # Test that we find PSR-18 Guzzle 6 + - expect: will-find + requirements: "php-http/guzzle6-adapter:^2.0.1" + method: "Http\\Discovery\\Psr18ClientDiscovery::find();" + # Test that we find PSR-18 Guzzle 7 + - expect: will-find + requirements: "guzzlehttp/guzzle:^7.0.1" + method: "Http\\Discovery\\Psr18ClientDiscovery::find();" + # Test that we find PSR-18 Symfony 4 + - expect: will-find + requirements: "symfony/http-client:^4 php-http/httplug nyholm/psr7:^1.3" + method: "Http\\Discovery\\Psr18ClientDiscovery::find();" + # Test that we find PSR-18 Symfony 5 + - expect: will-find + requirements: "symfony/http-client:^5 php-http/httplug nyholm/psr7:^1.3" + method: "Http\\Discovery\\Psr18ClientDiscovery::find();" + # Test that we find PSR-17 http-interop + - expect: will-find + requirements: "http-interop/http-factory-guzzle:^1" + method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" + # Test that we find PSR-17 nyholm + - expect: will-find + requirements: "nyholm/psr7:^1.3" + method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" + # Test that we find Phalcon with PSR + - expect: will-find + pecl: "psr-1.0.0, phalcon-4.0.6" + method: "Http\\Discovery\\Psr17FactoryDiscovery::findRequestFactory();" + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer:v2 + coverage: xdebug + extensions: ${{ matrix.pecl }} + + - name: Check Install + run: | + tests/install.sh ${{ matrix.expect }} "${{ matrix.method }}" "${{ matrix.requirements }}" diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..6602807 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,21 @@ +name: Static analysis + +on: + push: + branches: + - master + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --dry-run diff --git a/.gitignore b/.gitignore index 1eb3d53..965a6e8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /phpunit.xml /puli.json /vendor/ +.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..83809c2 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,16 @@ +in(__DIR__.'/src') + ->name('*.php') +; + +$config = (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; + +return $config; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 23ba165..0000000 --- a/.php_cs +++ /dev/null @@ -1,13 +0,0 @@ -&1 - local ok=$? - (exit $ok) && - echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" || - echo -e "\\e[41mKO\\e[0m $title\\n" - (exit $ok) - } - export -f install_test - - script: - # Test that we find Guzzle 6 v1 - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^1.1.1" - # Test that we find Guzzle 6 v2 - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle6-adapter:^2.0.1" - # Test that we find Guzzle 7 Adapter - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/guzzle7-adapter:^0.1" - # Test that we find a client with Symfony and Guzzle PSR-7 - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.* http-interop/http-factory-guzzle" - # We should fail if we dont have php-http/message-factory or PSR-17 - - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*" - - install_test cant-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug guzzlehttp/psr7:1.* http-interop/http-factory-guzzle" - # We should be able to find a client when Symfony is only partly installed and we have guzzle adapter installed - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "symfony/http-client:5.* php-http/guzzle6-adapter php-http/httplug php-http/message-factory guzzlehttp/psr7:1.*" - # Test that we find a client with Symfony and Guzzle - - install_test will-find "Http\Discovery\HttpClientDiscovery::find();" "php-http/client-common:2.* php-http/message:1.8.* symfony/http-client:4.* php-http/guzzle6-adapter" - # Test that we find an async client with Symfony and Guzzle - - install_test will-find "Http\Discovery\HttpAsyncClientDiscovery::find();" "php-http/client-common:2.* php-http/message:1.8.* symfony/http-client:4.* php-http/guzzle6-adapter" - # Test that we find PSR-18 Guzzle 6 - - install_test will-find "Http\Discovery\Psr18ClientDiscovery::find();" "php-http/guzzle6-adapter:^2.0.1" - # Test that we find PSR-18 Guzzle 7 - - install_test will-find "Http\Discovery\Psr18ClientDiscovery::find();" "guzzlehttp/guzzle:^7.0.1" - # Test that we find PSR-18 Symfony 4 - - install_test will-find "Http\Discovery\Psr18ClientDiscovery::find();" "symfony/http-client:4.* php-http/httplug nyholm/psr7:^1.3" - # Test that we find PSR-18 Symfony 5 - - install_test will-find "Http\Discovery\Psr18ClientDiscovery::find();" "symfony/http-client:5.* php-http/httplug nyholm/psr7:^1.3" - # Test that we find PSR-17 http-interop - - install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "http-interop/http-factory-guzzle:1.*" - # Test that we find PSR-17 nyholm - - install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "nyholm/psr7:^1.3" - # Test that we find Phalcon with PSR - - install_test will-find "Http\Discovery\Psr17FactoryDiscovery::findRequestFactory();" "" "psr-1.0.0 phalcon-4.0.6" - -before_install: - - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; - -install: - - wget https://github.com/puli/cli/releases/download/1.0.0-beta10/puli.phar && chmod +x puli.phar - - composer require puli/composer-plugin:${PULI_VERSION} --no-update - - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction - -script: - - $TEST_COMMAND - -after_success: - - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi diff --git a/composer.json b/composer.json index 5ded29e..42d6260 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,7 @@ "graham-campbell/phpspec-skip-example-extension": "^5.0", "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1", - "puli/composer-plugin": "1.0.0-beta10" + "phpspec/phpspec": "^5.1 || ^6.1" }, "suggest": { "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" diff --git a/spec/ClassDiscoverySpec.php b/spec/ClassDiscoverySpec.php index e29b0ba..fde8eb9 100644 --- a/spec/ClassDiscoverySpec.php +++ b/spec/ClassDiscoverySpec.php @@ -5,10 +5,6 @@ use Http\Discovery\ClassDiscovery; use Http\Discovery\Exception\DiscoveryFailedException; use Http\Discovery\Strategy\DiscoveryStrategy; -use Puli\Discovery\Binding\ClassBinding; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; use spec\Http\Discovery\Helper\FailedDiscoveryStrategy; diff --git a/spec/HttpAsyncClientDiscoverySpec.php b/spec/HttpAsyncClientDiscoverySpec.php index d3c037a..8fe2dff 100644 --- a/spec/HttpAsyncClientDiscoverySpec.php +++ b/spec/HttpAsyncClientDiscoverySpec.php @@ -7,10 +7,6 @@ use Http\Discovery\NotFoundException; use Http\Discovery\Strategy\DiscoveryStrategy; use Prophecy\Argument; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Discovery\Binding\ClassBinding; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; diff --git a/spec/HttpClientDiscoverySpec.php b/spec/HttpClientDiscoverySpec.php index a5d4259..4879841 100644 --- a/spec/HttpClientDiscoverySpec.php +++ b/spec/HttpClientDiscoverySpec.php @@ -6,10 +6,6 @@ use Http\Discovery\ClassDiscovery; use Http\Discovery\NotFoundException; use Http\Discovery\Strategy\DiscoveryStrategy; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Discovery\Binding\ClassBinding; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; use Http\Discovery\HttpClientDiscovery; @@ -34,7 +30,7 @@ function it_is_a_class_discovery() $this->shouldHaveType(ClassDiscovery::class); } - function it_finds_a_http_client(DiscoveryStrategy $strategy) + function it_finds_a_http_client(DiscoveryStrategy $strategy) { $candidate = ['class' => HttpClientStub::class, 'condition' => true]; if ($this->psr18IsInUse()) { @@ -57,7 +53,7 @@ private function psr18IsInUse() } $reflection = new \ReflectionMethod(HttpClient::class, 'sendRequest'); - + return $reflection->hasReturnType(); } } diff --git a/spec/MessageFactoryDiscoverySpec.php b/spec/MessageFactoryDiscoverySpec.php index 843c0b4..ecb852c 100644 --- a/spec/MessageFactoryDiscoverySpec.php +++ b/spec/MessageFactoryDiscoverySpec.php @@ -6,10 +6,6 @@ use Http\Discovery\NotFoundException; use Http\Discovery\Strategy\DiscoveryStrategy; use Http\Message\MessageFactory; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Discovery\Binding\ClassBinding; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; diff --git a/spec/Strategy/PuliSpec.php b/spec/Strategy/PuliSpec.php index dbf35a8..d303942 100644 --- a/spec/Strategy/PuliSpec.php +++ b/spec/Strategy/PuliSpec.php @@ -2,8 +2,6 @@ namespace spec\Http\Discovery\Strategy; -use Http\Discovery\ClassDiscovery; -use Http\Discovery\Exception\NotFoundException; use Http\Discovery\Strategy\PuliBetaStrategy; use Puli\Discovery\Binding\ClassBinding; use Puli\GeneratedPuliFactory; diff --git a/spec/StreamFactoryDiscoverySpec.php b/spec/StreamFactoryDiscoverySpec.php index 2e9178e..a5e210b 100644 --- a/spec/StreamFactoryDiscoverySpec.php +++ b/spec/StreamFactoryDiscoverySpec.php @@ -6,10 +6,6 @@ use Http\Discovery\NotFoundException; use Http\Discovery\Strategy\DiscoveryStrategy; use Http\Message\StreamFactory; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Discovery\Binding\ClassBinding; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; diff --git a/spec/UriFactoryDiscoverySpec.php b/spec/UriFactoryDiscoverySpec.php index db92984..f34ae57 100644 --- a/spec/UriFactoryDiscoverySpec.php +++ b/spec/UriFactoryDiscoverySpec.php @@ -6,10 +6,6 @@ use Http\Discovery\NotFoundException; use Http\Discovery\Strategy\DiscoveryStrategy; use Http\Message\UriFactory; -use Puli\GeneratedPuliFactory; -use Puli\Discovery\Api\Discovery; -use Puli\Discovery\Binding\ClassBinding; -use Puli\Repository\Api\ResourceRepository; use PhpSpec\ObjectBehavior; use spec\Http\Discovery\Helper\DiscoveryHelper; diff --git a/spec/autoload.php b/spec/autoload.php index ea9329f..6fd8eac 100644 --- a/spec/autoload.php +++ b/spec/autoload.php @@ -8,6 +8,6 @@ ]); } -if (PHP_VERSION_ID < 70300) { +if (PHP_VERSION_ID < 70300 && class_exists('Puli\\GeneratedPuliFactory')) { class PuliIsSupported {} } diff --git a/src/ClassDiscovery.php b/src/ClassDiscovery.php index 4352985..4f47f3c 100644 --- a/src/ClassDiscovery.php +++ b/src/ClassDiscovery.php @@ -206,7 +206,7 @@ protected static function evaluateCondition($condition) /** * Get an instance of the $class. * - * @param string|\Closure $class A FQCN of a class or a closure that instantiate the class. + * @param string|\Closure $class a FQCN of a class or a closure that instantiate the class * * @return object * diff --git a/src/Exception/NotFoundException.php b/src/Exception/NotFoundException.php index 4345ac0..ef8b9c5 100644 --- a/src/Exception/NotFoundException.php +++ b/src/Exception/NotFoundException.php @@ -11,6 +11,6 @@ * * @author Márk Sági-Kazár */ -/*final*/ class NotFoundException extends \RuntimeException implements Exception +/* final */ class NotFoundException extends \RuntimeException implements Exception { } diff --git a/src/Strategy/CommonClassesStrategy.php b/src/Strategy/CommonClassesStrategy.php index e82bcb1..b950e96 100644 --- a/src/Strategy/CommonClassesStrategy.php +++ b/src/Strategy/CommonClassesStrategy.php @@ -2,45 +2,45 @@ namespace Http\Discovery\Strategy; +use GuzzleHttp\Client as GuzzleHttp; use GuzzleHttp\Promise\Promise; use GuzzleHttp\Psr7\Request as GuzzleRequest; +use Http\Adapter\Artax\Client as Artax; +use Http\Adapter\Buzz\Client as Buzz; +use Http\Adapter\Cake\Client as Cake; +use Http\Adapter\Guzzle5\Client as Guzzle5; +use Http\Adapter\Guzzle6\Client as Guzzle6; +use Http\Adapter\Guzzle7\Client as Guzzle7; +use Http\Adapter\React\Client as React; +use Http\Adapter\Zend\Client as Zend; +use Http\Client\Curl\Client as Curl; use Http\Client\HttpAsyncClient; use Http\Client\HttpClient; +use Http\Client\Socket\Client as Socket; use Http\Discovery\Exception\NotFoundException; use Http\Discovery\MessageFactoryDiscovery; use Http\Discovery\Psr17FactoryDiscovery; -use Http\Message\RequestFactory; -use Psr\Http\Message\RequestFactoryInterface as Psr17RequestFactory; use Http\Message\MessageFactory; +use Http\Message\MessageFactory\DiactorosMessageFactory; use Http\Message\MessageFactory\GuzzleMessageFactory; +use Http\Message\MessageFactory\SlimMessageFactory; +use Http\Message\RequestFactory; use Http\Message\StreamFactory; +use Http\Message\StreamFactory\DiactorosStreamFactory; use Http\Message\StreamFactory\GuzzleStreamFactory; +use Http\Message\StreamFactory\SlimStreamFactory; use Http\Message\UriFactory; -use Http\Message\UriFactory\GuzzleUriFactory; -use Http\Message\MessageFactory\DiactorosMessageFactory; -use Http\Message\StreamFactory\DiactorosStreamFactory; use Http\Message\UriFactory\DiactorosUriFactory; -use Psr\Http\Client\ClientInterface as Psr18Client; -use Zend\Diactoros\Request as ZendDiactorosRequest; -use Laminas\Diactoros\Request as DiactorosRequest; -use Http\Message\MessageFactory\SlimMessageFactory; -use Http\Message\StreamFactory\SlimStreamFactory; +use Http\Message\UriFactory\GuzzleUriFactory; use Http\Message\UriFactory\SlimUriFactory; +use Laminas\Diactoros\Request as DiactorosRequest; +use Nyholm\Psr7\Factory\HttplugFactory as NyholmHttplugFactory; +use Psr\Http\Client\ClientInterface as Psr18Client; +use Psr\Http\Message\RequestFactoryInterface as Psr17RequestFactory; use Slim\Http\Request as SlimRequest; -use GuzzleHttp\Client as GuzzleHttp; -use Http\Adapter\Guzzle7\Client as Guzzle7; -use Http\Adapter\Guzzle6\Client as Guzzle6; -use Http\Adapter\Guzzle5\Client as Guzzle5; -use Http\Client\Curl\Client as Curl; -use Http\Client\Socket\Client as Socket; -use Http\Adapter\React\Client as React; -use Http\Adapter\Buzz\Client as Buzz; -use Http\Adapter\Cake\Client as Cake; -use Http\Adapter\Zend\Client as Zend; -use Http\Adapter\Artax\Client as Artax; use Symfony\Component\HttpClient\HttplugClient as SymfonyHttplug; use Symfony\Component\HttpClient\Psr18Client as SymfonyPsr18; -use Nyholm\Psr7\Factory\HttplugFactory as NyholmHttplugFactory; +use Zend\Diactoros\Request as ZendDiactorosRequest; /** * @internal diff --git a/src/Strategy/DiscoveryStrategy.php b/src/Strategy/DiscoveryStrategy.php index 641485a..1eadb14 100644 --- a/src/Strategy/DiscoveryStrategy.php +++ b/src/Strategy/DiscoveryStrategy.php @@ -17,7 +17,7 @@ interface DiscoveryStrategy * @return array The return value is always an array with zero or more elements. Each * element is an array with two keys ['class' => string, 'condition' => mixed]. * - * @throws StrategyUnavailableException if we cannot use this strategy. + * @throws StrategyUnavailableException if we cannot use this strategy */ public static function getCandidates($type); } diff --git a/tests/install.sh b/tests/install.sh index b1a6d4c..01da882 100755 --- a/tests/install.sh +++ b/tests/install.sh @@ -17,13 +17,12 @@ echo "Using directory: ${BUILD_DIR}" mkdir -p $BUILD_DIR # Init composer -composer init --working-dir $BUILD_DIR --no-interaction composer req --working-dir $BUILD_DIR php-http/discovery --no-update # Argument 3 installs additional composer packages composer req --working-dir $BUILD_DIR $3 -# Arg 4 means some pecl things will be install +# Arg 4 means we need to install pecl libraries if ! [ -z "$4" ]; then pecl install $4 fi