From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- .../guzzle/src/Guzzle/Iterator/AppendIterator.php | 19 ++++++++ .../guzzle/src/Guzzle/Iterator/ChunkedIterator.php | 56 ++++++++++++++++++++++ .../guzzle/src/Guzzle/Iterator/FilterIterator.php | 36 ++++++++++++++ .../guzzle/src/Guzzle/Iterator/MapIterator.php | 34 +++++++++++++ .../src/Guzzle/Iterator/MethodProxyIterator.php | 27 +++++++++++ vendor/guzzle/guzzle/src/Guzzle/Iterator/README.md | 25 ++++++++++ .../guzzle/src/Guzzle/Iterator/composer.json | 27 +++++++++++ 7 files changed, 224 insertions(+) create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/README.md create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Iterator/composer.json (limited to 'vendor/guzzle/guzzle/src/Guzzle/Iterator') diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php b/vendor/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php new file mode 100644 index 0000000..1b6bd7e --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/AppendIterator.php @@ -0,0 +1,19 @@ +getArrayIterator()->append($iterator); + } +} diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php b/vendor/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php new file mode 100644 index 0000000..d76cdd4 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/ChunkedIterator.php @@ -0,0 +1,56 @@ +chunkSize = $chunkSize; + } + + public function rewind() + { + parent::rewind(); + $this->next(); + } + + public function next() + { + $this->chunk = array(); + for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) { + $this->chunk[] = parent::current(); + parent::next(); + } + } + + public function current() + { + return $this->chunk; + } + + public function valid() + { + return (bool) $this->chunk; + } +} diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php b/vendor/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php new file mode 100644 index 0000000..b103367 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/FilterIterator.php @@ -0,0 +1,36 @@ +callback = $callback; + } + + public function accept() + { + return call_user_func($this->callback, $this->current()); + } +} diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php b/vendor/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php new file mode 100644 index 0000000..7e586bd --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/MapIterator.php @@ -0,0 +1,34 @@ +callback = $callback; + } + + public function current() + { + return call_user_func($this->callback, parent::current()); + } +} diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php b/vendor/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php new file mode 100644 index 0000000..de4ab03 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/MethodProxyIterator.php @@ -0,0 +1,27 @@ +getInnerIterator(); + while ($i instanceof \OuterIterator) { + $i = $i->getInnerIterator(); + } + + return call_user_func_array(array($i, $name), $args); + } +} diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/README.md b/vendor/guzzle/guzzle/src/Guzzle/Iterator/README.md new file mode 100644 index 0000000..8bb7e08 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/README.md @@ -0,0 +1,25 @@ +Guzzle Iterator +=============== + +Provides useful Iterators and Iterator decorators + +- ChunkedIterator: Pulls out chunks from an inner iterator and yields the chunks as arrays +- FilterIterator: Used when PHP 5.4's CallbackFilterIterator is not available +- MapIterator: Maps values before yielding +- MethodProxyIterator: Proxies missing method calls to the innermost iterator + +### Installing via Composer + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php + +# Add Guzzle as a dependency +php composer.phar require guzzle/iterator:~3.0 +``` + +After installing, you need to require Composer's autoloader: + +```php +require 'vendor/autoload.php'; +``` diff --git a/vendor/guzzle/guzzle/src/Guzzle/Iterator/composer.json b/vendor/guzzle/guzzle/src/Guzzle/Iterator/composer.json new file mode 100644 index 0000000..ee17379 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Iterator/composer.json @@ -0,0 +1,27 @@ +{ + "name": "guzzle/iterator", + "description": "Provides helpful iterators and iterator decorators", + "keywords": ["iterator", "guzzle"], + "homepage": "http://guzzlephp.org/", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.3.2", + "guzzle/common": ">=2.8.0" + }, + "autoload": { + "psr-0": { "Guzzle\\Iterator": "/" } + }, + "target-dir": "Guzzle/Iterator", + "extra": { + "branch-alias": { + "dev-master": "3.7-dev" + } + } +} -- cgit v1.2.3-54-g00ecf