ecCodewordsPerBlock = $ecCodewordsPerBlock; $this->ecBlocks = $ecBlocks; } /** * Returns the number of EC codewords per block. */ public function getEcCodewordsPerBlock() : int { return $this->ecCodewordsPerBlock; } /** * Returns the total number of EC block appearances. */ public function getNumBlocks() : int { $total = 0; foreach ($this->ecBlocks as $ecBlock) { $total += $ecBlock->getCount(); } return $total; } /** * Returns the total count of EC codewords. */ public function getTotalEcCodewords() : int { return $this->ecCodewordsPerBlock * $this->getNumBlocks(); } /** * Returns the EC blocks included in this collection. * * @return EcBlock[] */ public function getEcBlocks() : array { return $this->ecBlocks; } }