protected function getPositionByType($score, $type) { // Count scores numbers $n = strlen($score) - 1 ?: 0; $coordinates = explode(':', $this->position[$type][$n]); return new Point($coordinates[0], $coordinates[1]); }