[COMPOSER] Add new php-ffmpeg package
This commit is contained in:
36
vendor/zendframework/zend-hydrator/src/Iterator/HydratingArrayIterator.php
vendored
Normal file
36
vendor/zendframework/zend-hydrator/src/Iterator/HydratingArrayIterator.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Hydrator\Iterator;
|
||||
|
||||
use ArrayIterator;
|
||||
use Zend\Hydrator\HydratorInterface;
|
||||
|
||||
class HydratingArrayIterator extends HydratingIteratorIterator
|
||||
{
|
||||
/**
|
||||
* @var HydratorInterface
|
||||
*/
|
||||
protected $hydrator;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
protected $prototype;
|
||||
|
||||
/**
|
||||
* @param HydratorInterface $hydrator
|
||||
* @param array $data
|
||||
* @param string|object $prototype Object, or class name to use for prototype.
|
||||
*/
|
||||
public function __construct(HydratorInterface $hydrator, array $data, $prototype)
|
||||
{
|
||||
parent::__construct($hydrator, new ArrayIterator($data), $prototype);
|
||||
}
|
||||
}
|
33
vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorInterface.php
vendored
Normal file
33
vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorInterface.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Hydrator\Iterator;
|
||||
|
||||
use Iterator;
|
||||
use Zend\Hydrator\HydratorInterface;
|
||||
|
||||
interface HydratingIteratorInterface extends Iterator
|
||||
{
|
||||
/**
|
||||
* This sets the prototype to hydrate.
|
||||
*
|
||||
* This prototype can be the name of the class or the object itself;
|
||||
* iteration will clone the object.
|
||||
*
|
||||
* @param string|object $prototype
|
||||
*/
|
||||
public function setPrototype($prototype);
|
||||
|
||||
/**
|
||||
* Sets the hydrator to use during iteration.
|
||||
*
|
||||
* @param HydratorInterface $hydrator
|
||||
*/
|
||||
public function setHydrator(HydratorInterface $hydrator);
|
||||
}
|
78
vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorIterator.php
vendored
Normal file
78
vendor/zendframework/zend-hydrator/src/Iterator/HydratingIteratorIterator.php
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework (http://framework.zend.com/)
|
||||
*
|
||||
* @link http://github.com/zendframework/zf2 for the canonical source repository
|
||||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
namespace Zend\Hydrator\Iterator;
|
||||
|
||||
use Iterator;
|
||||
use IteratorIterator;
|
||||
use Zend\Hydrator\Exception\InvalidArgumentException;
|
||||
use Zend\Hydrator\HydratorInterface;
|
||||
|
||||
class HydratingIteratorIterator extends IteratorIterator implements HydratingIteratorInterface
|
||||
{
|
||||
/**
|
||||
* @var HydratorInterface
|
||||
*/
|
||||
protected $hydrator;
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
protected $prototype;
|
||||
|
||||
/**
|
||||
* @param HydratorInterface $hydrator
|
||||
* @param Iterator $data
|
||||
* @param string|object $prototype Object or class name to use for prototype.
|
||||
*/
|
||||
public function __construct(HydratorInterface $hydrator, Iterator $data, $prototype)
|
||||
{
|
||||
$this->setHydrator($hydrator);
|
||||
$this->setPrototype($prototype);
|
||||
parent::__construct($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function setPrototype($prototype)
|
||||
{
|
||||
if (is_object($prototype)) {
|
||||
$this->prototype = $prototype;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!class_exists($prototype)) {
|
||||
throw new InvalidArgumentException(
|
||||
sprintf('Method %s was passed an invalid class name: %s', __METHOD__, $prototype)
|
||||
);
|
||||
}
|
||||
|
||||
$this->prototype = new $prototype;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function setHydrator(HydratorInterface $hydrator)
|
||||
{
|
||||
$this->hydrator = $hydrator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object Returns hydrated clone of $prototype
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
$currentValue = parent::current();
|
||||
$object = clone $this->prototype;
|
||||
$this->hydrator->hydrate($currentValue, $object);
|
||||
return $object;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user