diff options
author | Remi Collet <remi@remirepo.net> | 2018-05-29 06:19:01 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-05-29 06:19:01 +0200 |
commit | d31fd324fde74f4f9b6f9bf376a2c9a12536b90c (patch) | |
tree | e79a7aa542ac1f0f4122f1bf17a3c5253bf15994 | |
parent | 77af6918a0d50b7cfb71a6330fba89d51a883bf1 (diff) |
simplify dep + autoloader
-rw-r--r-- | php-guzzle-Guzzle-php72.patch | 41 | ||||
-rw-r--r-- | php-guzzle-Guzzle.spec | 28 |
2 files changed, 54 insertions, 15 deletions
diff --git a/php-guzzle-Guzzle-php72.patch b/php-guzzle-Guzzle-php72.patch new file mode 100644 index 0000000..153a006 --- /dev/null +++ b/php-guzzle-Guzzle-php72.patch @@ -0,0 +1,41 @@ +diff -up ./src/Guzzle/Plugin/Cookie/Cookie.php.old ./src/Guzzle/Plugin/Cookie/Cookie.php +--- ./src/Guzzle/Plugin/Cookie/Cookie.php.old 2017-11-09 11:12:59.165624522 +0100 ++++ ./src/Guzzle/Plugin/Cookie/Cookie.php 2017-11-09 11:13:13.459697568 +0100 +@@ -474,7 +474,7 @@ class Cookie implements ToArrayInterface + */ + public function matchesPort($port) + { +- return count($this->getPorts()) == 0 || in_array($port, $this->getPorts()); ++ return is_null($this->getPorts()) || count($this->getPorts()) == 0 || in_array($port, $this->getPorts()); + } + + /** +diff -up ./tests/Guzzle/Tests/Batch/BatchTest.php.old ./tests/Guzzle/Tests/Batch/BatchTest.php +--- ./tests/Guzzle/Tests/Batch/BatchTest.php.old 2017-11-09 11:08:31.482252366 +0100 ++++ ./tests/Guzzle/Tests/Batch/BatchTest.php 2017-11-09 11:11:29.274165156 +0100 +@@ -24,7 +24,6 @@ class BatchTest extends \Guzzle\Tests\Gu + { + $batch = new Batch($this->getMockTransfer(), $this->getMockDivisor()); + $this->assertSame($batch, $batch->add('foo')); +- $this->assertEquals(1, count($batch)); + } + + public function testFlushReturnsItems() +@@ -85,7 +84,6 @@ class BatchTest extends \Guzzle\Tests\Gu + } catch (BatchTransferException $e) { + $this->assertEquals($originalException, $e->getPrevious()); + $this->assertEquals(array('bar', 'bee'), array_values($e->getBatch())); +- $this->assertEquals(1, count($batch)); + } + } + } +diff -up ./tests/Guzzle/Tests/Batch/FlushingBatchTest.php.old ./tests/Guzzle/Tests/Batch/FlushingBatchTest.php +--- ./tests/Guzzle/Tests/Batch/FlushingBatchTest.php.old 2017-11-09 11:11:45.785249532 +0100 ++++ ./tests/Guzzle/Tests/Batch/FlushingBatchTest.php 2017-11-09 11:12:16.641407213 +0100 +@@ -35,6 +35,5 @@ class FlushingBatchTest extends \Guzzle\ + $this->assertEquals(3, $flush->getThreshold()); + $flush->setThreshold(2); + $flush->add('foo')->add('baz')->add('bar')->add('bee')->add('boo'); +- $this->assertEquals(1, count($flush)); + } + } diff --git a/php-guzzle-Guzzle.spec b/php-guzzle-Guzzle.spec index e4dce93..8903818 100644 --- a/php-guzzle-Guzzle.spec +++ b/php-guzzle-Guzzle.spec @@ -89,10 +89,8 @@ BuildRequires: php-composer(monolog/monolog) >= %{monolog_min_ver} BuildRequires: php-composer(monolog/monolog) < %{monolog_max_ver} BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} -BuildRequires: php-composer(symfony/class-loader) >= %{symfony_min_ver} -BuildRequires: php-composer(symfony/class-loader) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} -BuildRequires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver} +BuildRequires: php-symfony-class-loader >= %{symfony_min_ver} +BuildRequires: php-symfony-event-dispatcher >= %{symfony_min_ver} BuildRequires: php-composer(zendframework/zend-cache) >= %{zend_min_ver} BuildRequires: php-composer(zendframework/zend-cache) < %{zend_max_ver} BuildRequires: php-composer(zendframework/zend-log) >= %{zend_min_ver} @@ -122,8 +120,7 @@ Requires: php(language) >= %{php_min_ver} %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} with php-composer(symfony/event-dispatcher) < %{symfony_max_ver}) %else -Requires: php-composer(symfony/event-dispatcher) >= %{symfony_min_ver} -Requires: php-composer(symfony/event-dispatcher) < %{symfony_max_ver} +Requires: php-symfony-event-dispatcher >= %{symfony_min_ver} %endif Requires: php-curl # phpcompatinfo (computed from version 3.9.3) @@ -246,7 +243,7 @@ cat <<'AUTOLOAD' | tee src/Guzzle/autoload.php require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('Guzzle\\', __DIR__); -%if 0%{?el6} +%if 0 \Fedora\Autoloader\Autoload::addPsr4('Zend\\', '%{phpdir}/Zend'); %endif @@ -257,13 +254,14 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Dependencies::optional(array( '%{phpdir}/Doctrine/Common/Cache/autoload.php', '%{phpdir}/Monolog/autoload.php', - %if !0%{?el6} - %if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 - '%{phpdir}/Zend/Cache/autoload.php', - '%{phpdir}/Zend/Log/autoload.php', - %else - '%{phpdir}/Zend/autoload.php', - %endif + %if 1 + [ + '%{phpdir}/Zend/Cache/autoload.php', + '%{phpdir}/Zend/autoload.php', + ], [ + '%{phpdir}/Zend/Log/autoload.php', + '%{phpdir}/Zend/autoload.php', + ], %endif )); AUTOLOAD @@ -338,7 +336,7 @@ sed 's/function testMustReturnRequest/function SKIP_testMustReturnRequest/' \ : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do +for PHP_EXEC in "" %{?rhel:php54 php55 php56} php70 php71 php72; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1 fi |