You are here

public function CompositeNamingStrategy::__construct in Zircon Profile 8

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

Parameters

NamingStrategyInterface[] $strategies indexed by the name they translate:

NamingStrategyInterface|null $defaultNamingStrategy:

File

vendor/zendframework/zend-hydrator/src/NamingStrategy/CompositeNamingStrategy.php, line 28

Class

CompositeNamingStrategy

Namespace

Zend\Hydrator\NamingStrategy

Code

public function __construct(array $strategies, NamingStrategyInterface $defaultNamingStrategy = null) {
  $this->namingStrategies = array_map(function (NamingStrategyInterface $strategy) {

    // this callback is here only to ensure type-safety
    return $strategy;
  }, $strategies);
  $this->defaultNamingStrategy = $defaultNamingStrategy ?: new IdentityNamingStrategy();
}