/**
  * @param array $extractedBox
  *
  * @return SudokuBox
  */
 public function build(array $extractedBox)
 {
     $this->dimensionValidator->validate($extractedBox, 3, 3);
     return new $this->class($extractedBox, $this->arrayHelper);
 }
 /**
  * @param array $extractedColumn
  *
  * @return SudokuColumn
  */
 public function build(array $extractedColumn)
 {
     $this->dimensionValidator->validate($extractedColumn, 9, 1);
     $row = $this->arrayHelper->convertTo1d($extractedColumn);
     return new $this->class($row);
 }
 /**
  * @expectedException RuntimeException
  */
 public function testCorrectDimensionsWithInconsistentRows()
 {
     $array = array(array(1, 2, 3), array(4, 5, 6, 6), array(7, 8, 9));
     $this->validator->validate($array, 3, 3);
 }
Example #4
0
 /**
  * @param array $sudoku
  *
  * @return Sudoku
  */
 public function build(array $sudoku)
 {
     $this->dimensionValidator->validate($sudoku, 9, 9);
     return new $this->class($sudoku, $this->rowFactory, $this->columnFactory, $this->boxFactory, $this->arrayHelper);
 }