Skip to content

Commit

Permalink
Chore: Remove Zend Diactoros (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
misaert authored Jun 21, 2023
1 parent a6fa791 commit 3edd771
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 102 deletions.
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,22 @@ script:
- mkdir -p build/logs && ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

# League/Uri isolated factory test
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 zendframework/zend-diactoros ringcentral/psr7
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 ringcentral/psr7
- composer req --dev --prefer-dist league/uri:^5.0
- ./vendor/bin/phpunit tests/UriFactoryTest.php

# Zend Diactoros isolated ffactory test
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 zendframework/zend-diactoros ringcentral/psr7
- composer req --dev --prefer-dist zendframework/zend-diactoros
- ./vendor/bin/phpunit tests/UriFactoryTest.php

# Guzzle PSR-7 isolated ffactory test
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 zendframework/zend-diactoros ringcentral/psr7
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 ringcentral/psr7
- composer req --dev --prefer-dist guzzlehttp/psr7
- ./vendor/bin/phpunit tests/UriFactoryTest.php

# Nyholm PSR-7 isolated ffactory test
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 zendframework/zend-diactoros ringcentral/psr7
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 ringcentral/psr7
- composer req --dev --prefer-dist nyholm/psr7
- ./vendor/bin/phpunit tests/UriFactoryTest.php

# Nyholm PSR-7 isolated ffactory test
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 zendframework/zend-diactoros ringcentral/psr7
- composer rem --dev league/uri nyholm/psr7 guzzlehttp/psr7 ringcentral/psr7
- composer req --dev --prefer-dist ringcentral/psr7
- ./vendor/bin/phpunit tests/UriFactoryTest.php

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ There are several PSR-7 libraries on packagist but each one has its own factory
Supported libraries so far:

* `guzzlehttp/psr7`
* `zendframework/zend-diactoros`
* `league/uri`
* `nyholm/psr7`
* `ringcentral/psr7`
Expand All @@ -39,17 +38,14 @@ You can specify which library to use, by using the corresponding adapter:
```php
use BenTools\UriFactory\Adapter\GuzzleAdapter;
use BenTools\UriFactory\Adapter\LeagueUriAdapter;
use BenTools\UriFactory\Adapter\ZendDiactorosAdapter;
use function BenTools\UriFactory\Helper\current_location;
use function BenTools\UriFactory\Helper\uri;

$uri = uri('http://www.example.net', GuzzleAdapter::factory());
$uri = uri('http://www.example.net', LeagueUriAdapter::factory());
$uri = uri('http://www.example.net', ZendDiactorosAdapter::factory());

$uri = current_location(GuzzleAdapter::factory());
$uri = current_location(LeagueUriAdapter::factory());
$uri = current_location(ZendDiactorosAdapter::factory());
```

## Canonicalizer
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"phpunit/phpunit": "~6.0|~7.0",
"ringcentral/psr7": "^1.3",
"squizlabs/php_codesniffer": "@stable",
"symfony/var-dumper": "^3.3",
"zendframework/zend-diactoros": "^1.6"
"symfony/var-dumper": "^3.3"
},
"autoload": {
"psr-4": {
Expand All @@ -46,7 +45,6 @@
},
"suggest": {
"league/uri": "URI manipulation Library",
"zendframework/zend-diactoros": "PSR-7 HTTP Message implementation",
"guzzlehttp/psr7": "PSR-7 HTTP message library",
"nyholm/psr7": "PSR-7 HTTP message library",
"ringcentral/psr7": "PSR-7 HTTP message library"
Expand Down
42 changes: 0 additions & 42 deletions src/Adapter/ZendDiactorosAdapter.php

This file was deleted.

4 changes: 1 addition & 3 deletions src/UriFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use BenTools\UriFactory\Adapter\LeagueUriAdapter;
use BenTools\UriFactory\Adapter\NyholmAdapter;
use BenTools\UriFactory\Adapter\RingCentralAdapter;
use BenTools\UriFactory\Adapter\ZendDiactorosAdapter;
use Psr\Http\Message\UriInterface;

class UriFactory implements UriFactoryInterface
Expand All @@ -34,7 +33,6 @@ private function getDefaultAdapters()
return [
NyholmAdapter::class,
GuzzleAdapter::class,
ZendDiactorosAdapter::class,
LeagueUriAdapter::class,
RingCentralAdapter::class,
];
Expand All @@ -58,7 +56,7 @@ public function createUri(string $uri = '', UriFactoryInterface $factory = null)
}
}
throw new \RuntimeException(
"No adapter is installed. Please install guzzlehttp/psr7, zendframework/zend-diactoros or league/uri."
"No adapter is installed. Please install nyholm/psr7, ringcentral/psr7, guzzlehttp/psr7 or league/uri."
);
}

Expand Down
39 changes: 0 additions & 39 deletions tests/Adapter/ZendDiactorosAdapterTest.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/UriFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

use BenTools\UriFactory\Adapter\GuzzleAdapter;
use BenTools\UriFactory\Adapter\LeagueUriAdapter;
use BenTools\UriFactory\Adapter\ZendDiactorosAdapter;
use BenTools\UriFactory\UriFactory;
use GuzzleHttp\Psr7\Uri as GuzzleUri;
use League\Uri\Http as LeagueUri;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\UriInterface;
use function BenTools\UriFactory\Helper\current_location;
use function BenTools\UriFactory\Helper\uri;
use Zend\Diactoros\Uri as ZendUri;

class UriFactoryTest extends TestCase
{
Expand Down

0 comments on commit 3edd771

Please sign in to comment.