public function create($bucketType, $bucketParams)
    {
        if (!isset($this->factories[$bucketType])) {
            throw new \LogicException("No factory found for aggregation of type {$bucketType}");
        }

        return $this->factories[$bucketType]->create($bucketParams);
    }
public function create($bucketType, $bucketParams)
    {
        if (!isset($this->factories[$bucketType])) {
            throw new \LogicException("No factory found for aggregation of type {$bucketType}");
        }

        return $this->factories[$bucketType]->create($bucketParams);
    }
public function create ( $ bucketType , $ bucketParams ) { if ( ! isset ( $ this -> factories [ $ bucketType ] ) ) { throw new \ LogicException ( "No factory found for aggregation of type {$bucketType}" ) ; } return $ this -> factories [ $ bucketType ] -> create ( $ bucketParams ) ; }
Create a new bucket from it's type and params.

@param string $bucketType   Bucket type (must be a valid bucket type defined into the factories array).
@param array  $bucketParams Bucket constructor params.

@return BucketInterface
Create a new bucket from it s type and params .