You are here

public function StrategyChain::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-hydrator/src/Strategy/StrategyChain.php \Zend\Hydrator\Strategy\StrategyChain::__construct()

Constructor

Parameters

array|Traversable $extractionStrategies:

File

vendor/zendframework/zend-hydrator/src/Strategy/StrategyChain.php, line 36

Class

StrategyChain

Namespace

Zend\Hydrator\Strategy

Code

public function __construct($extractionStrategies) {
  $extractionStrategies = ArrayUtils::iteratorToArray($extractionStrategies);
  $this->extractionStrategies = array_map(function (StrategyInterface $strategy) {

    // this callback is here only to ensure type-safety
    return $strategy;
  }, $extractionStrategies);
  $this->hydrationStrategies = array_reverse($extractionStrategies);
}