/** * Find winner and store win lines * * @param Board $board * @param $category * @param null $line * */ protected function processPositions(Board $board, $category, $line = null) { $method = 'get' . $category . 'Positions'; $positions = $board->{$method}($line); $winCount = $board->getWinCountByPositions($positions); if ($this->mergeWinCount($winCount)) { $this->winLines[$winCount->getWinner()] = $positions; } }