diff --git a/.travis.yml b/.travis.yml index 1778618..492949f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ -dist: trusty -sudo: false +dist: bionic + language: php php: @@ -7,9 +7,10 @@ php: - '7.2' - '7.3' - '7.4' + - '8.0snapshot' before_script: - - composer install --dev + - composer update --no-interaction --no-progress script: - php bin/phpspec run -f pretty diff --git a/README.md b/README.md index 18d06bd..8576ec0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Simple object oriented wrapper for Packagist API. ## Requirements -* PHP ^7.1 +* PHP `^7.1 || ^8.0` ## Installation diff --git a/composer.json b/composer.json index c1c77bc..b067184 100644 --- a/composer.json +++ b/composer.json @@ -12,12 +12,12 @@ } ], "require": { - "php": ">=7.1", - "guzzlehttp/guzzle": "~6.0", - "doctrine/inflector": "~1.0 || ~2.0" + "php": "^7.1 || ^8.0", + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "doctrine/inflector": "^1.0 || ^2.0" }, "require-dev": { - "phpspec/phpspec": "~5.1 || ~6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0", "squizlabs/php_codesniffer": "^3.0" }, "config": { diff --git a/spec/Packagist/Api/ClientSpec.php b/spec/Packagist/Api/ClientSpec.php index 4fbc802..79158f6 100644 --- a/spec/Packagist/Api/ClientSpec.php +++ b/spec/Packagist/Api/ClientSpec.php @@ -28,7 +28,7 @@ function it_search_for_packages(HttpClient $client, Factory $factory, Response $ $data = file_get_contents('spec/Packagist/Api/Fixture/search.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array()); $this->search('sylius'); @@ -39,7 +39,7 @@ function it_search_for_packages_with_limit(HttpClient $client, Factory $factory, $data = file_get_contents('spec/Packagist/Api/Fixture/search.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/search.json?q=sylius')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array()); $this->search('sylius', [], 2); @@ -50,7 +50,7 @@ function it_searches_for_packages_with_filters(HttpClient $client, Factory $fact $data = file_get_contents('spec/Packagist/Api/Fixture/search.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/search.json?tag=storage&q=sylius')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/search.json?tag=storage&q=sylius')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array()); @@ -62,7 +62,7 @@ function it_gets_popular_packages(HttpClient $client, Factory $factory, Response $data = file_get_contents('spec/Packagist/Api/Fixture/popular.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/explore/popular.json?page=1')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/explore/popular.json?page=1')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled()->willReturn(array_pad(array(), 5, null)); @@ -74,7 +74,7 @@ function it_gets_package_details(HttpClient $client, Factory $factory, Response $data = file_get_contents('spec/Packagist/Api/Fixture/get.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/packages/sylius/sylius.json')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/packages/sylius/sylius.json')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled(); @@ -86,7 +86,7 @@ function it_lists_all_package_names(HttpClient $client, Factory $factory, Respon $data = file_get_contents('spec/Packagist/Api/Fixture/all.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/packages/list.json')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/packages/list.json')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled(); @@ -98,7 +98,7 @@ function it_filters_package_names_by_type(HttpClient $client, Factory $factory, $data = file_get_contents('spec/Packagist/Api/Fixture/all.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/packages/list.json?type=library')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/packages/list.json?type=library')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled(); @@ -110,7 +110,7 @@ function it_filters_package_names_by_vendor(HttpClient $client, Factory $factory $data = file_get_contents('spec/Packagist/Api/Fixture/all.json'); $response->getBody()->shouldBeCalled()->willReturn($data); - $client->request('get', 'https://packagist.org/packages/list.json?vendor=sylius')->shouldBeCalled()->willReturn($response); + $client->request('GET', 'https://packagist.org/packages/list.json?vendor=sylius')->shouldBeCalled()->willReturn($response); $factory->create(json_decode($data, true))->shouldBeCalled(); diff --git a/src/Packagist/Api/Client.php b/src/Packagist/Api/Client.php index 00f4edb..9db99f5 100644 --- a/src/Packagist/Api/Client.php +++ b/src/Packagist/Api/Client.php @@ -199,7 +199,7 @@ protected function request($url) } return $this->httpClient - ->request('get', $url) + ->request('GET', $url) ->getBody(); }