ecCodewordsPerBlock = $ecCodewordsPerBlock; $this->ecBlocks = new SplFixedArray($ecb2 === null ? 1 : 2); $this->ecBlocks[0] = $ecb1; if ($ecb2 !== null) { $this->ecBlocks[1] = $ecb2; } } /** * Gets the number of EC codewords per block. * * @return integer */ public function getEcCodewordsPerBlock() { return $this->ecCodewordsPerBlock; } /** * Gets the total number of EC block appearances. * * @return integer */ public function getNumBlocks() { $total = 0; foreach ($this->ecBlocks as $ecBlock) { $total += $ecBlock->getCount(); } return $total; } /** * Gets the total count of EC codewords. * * @return integer */ public function getTotalEcCodewords() { return $this->ecCodewordsPerBlock * $this->getNumBlocks(); } /** * Gets the EC blocks included in this collection. * * @return SplFixedArray */ public function getEcBlocks() { return $this->ecBlocks; } }