Get the token at a given position.

@param Integer $position
the position of the token
@return TokenInfo the token found
421953
public function peekTokenAt($position) {
		if ($position < count($this->tokens)) {
			return $this->tokens[$position];
		} else {
			return null;
		}
	}
211058
public function getByte($position = null)
    {
        $position = (int) ($position !== null ? $position : $this->offset);
        if ($position >= $this->bufferLength &&
            (!$this->increaseLength() || $position >= $this->bufferLength)
        ) {
            return false;
        }

        return $this->buffer[$position];
    }
1274770
public function getToken(Location $location = null)
    {
        if (!$location) {
            return $this->token;
        }

        $repository = $this->em->getRepository('CampaignChainSecurityAuthenticationClientOAuthBundle:Token');
        $token = $repository->findOneByLocation($location);

        if (!$token) {
            throw new \Exception(
                'No token found for location '.$location->getId()
            );
        }

        return $token;
    }
16283
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getLocale();
                break;
            case 2:
                return $this->getValue();
                break;
            default:
                return null;
                break;
        } // switch()
    }
231141
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getType();
                break;
            case 2:
                return $this->getName();
                break;
            case 3:
                return $this->getDomain();
                break;
            case 4:
                return $this->getApiUrl();
                break;
            case 5:
                return $this->getApiAuthHttpUser();
                break;
            case 6:
                return $this->getApiAuthHttpPassword();
                break;
            case 7:
                return $this->getApiAuthType();
                break;
            case 8:
                return $this->getApiAuthUser();
                break;
            case 9:
                return $this->getApiAuthPassword();
                break;
            case 10:
                return $this->getApiAuthToken();
                break;
            case 11:
                return $this->getApiAuthUrlUserKey();
                break;
            case 12:
                return $this->getApiAuthUrlPwKey();
                break;
            case 13:
                return $this->getCron();
                break;
            case 14:
                return $this->getCustomerId();
                break;
            case 15:
                return $this->getActivated();
                break;
            case 16:
                return $this->getNotes();
                break;
            case 17:
                return $this->getLastRun();
                break;
            case 18:
                return $this->getIncludelog();
                break;
            case 19:
                return $this->getPublicKey();
                break;
            case 20:
                return $this->getWebsiteHash();
                break;
            case 21:
                return $this->getNotificationRecipient();
                break;
            case 22:
                return $this->getNotificationSender();
                break;
            case 23:
                return $this->getNotificationChange();
                break;
            case 24:
                return $this->getNotificationError();
                break;
            default:
                return null;
                break;
        } // switch()
    }
270760
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getCreatedAt();
                break;
            case 2:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }
1259942
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getPersonId();
                break;
            case 2:
                return $this->getFunctionId();
                break;
            case 3:
                return $this->getCreatedAt();
                break;
            case 4:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }
184863
public function seek($position)
    {
        if (!isset($this->tokens[$position])) {
            throw $this->getOutOfBoundsException($position);
        }

        $this->position = $position;
    }
1081812
public function charAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		return mb_substr($this->string, $position, 1);
	}
1091319
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getTitle();
                break;
            case 2:
                return $this->getSlug();
                break;
            case 3:
                return $this->getAthleteLabel();
                break;
            case 4:
                return $this->getObjectSlug();
                break;
            case 5:
                return $this->getObjectLabel();
                break;
            case 6:
                return $this->getObjectPluralLabel();
                break;
            case 7:
                return $this->getSkillSlug();
                break;
            case 8:
                return $this->getSkillLabel();
                break;
            case 9:
                return $this->getSkillPluralLabel();
                break;
            case 10:
                return $this->getSkillPictureUrl();
                break;
            case 11:
                return $this->getGroupSlug();
                break;
            case 12:
                return $this->getGroupLabel();
                break;
            case 13:
                return $this->getGroupPluralLabel();
                break;
            case 14:
                return $this->getTransitionLabel();
                break;
            case 15:
                return $this->getTransitionPluralLabel();
                break;
            case 16:
                return $this->getTransitionsSlug();
                break;
            case 17:
                return $this->getPositionSlug();
                break;
            case 18:
                return $this->getPositionLabel();
                break;
            case 19:
                return $this->getFeatureComposition();
                break;
            case 20:
                return $this->getFeatureTester();
                break;
            case 21:
                return $this->getIsDefault();
                break;
            default:
                return null;
                break;
        } // switch()
    }
484946
public function getCellByPosition(TablePosition $position)
    {
        $row = $this->getRow($position->getRow());

        return $row ? $row->getCell($position->getCell()) : null;
    }
591720
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getLocale();
                break;
            case 2:
                return $this->getDescription();
                break;
            default:
                return null;
                break;
        } // switch()
    }
77186
public function getPrevious(int $step = 1) : Token {
      $position = ($this->position - $step);
      return ($this->items[$position]) ?? new Token();
    }
1069322
public function readToken(): Token
    {
        if ($this->getBuffer()->isEnd()) {
            try {
                $token = $this
                    ->getScanner()
                    ->readToken();
            } catch (UnknownSyntaxException $e) {
                throw new UnknownSyntaxException(
                    "Unknown syntax error near position #{$this->getNextPosition()}",
                    $this->getNextPosition(),
                    $e
                );
            }
            $this->assertErrorToken($token);
            $this
                ->getBuffer()
                ->addToken($token);
        }
        return $this
            ->getBuffer()
            ->readToken();
    }
609836
public function offsetGet($offset)
	{
		if(empty($this->tokens[$offset]))
		{
			throw new \OutOfBoundsException('No token found at offset ' . $offset);
		}

		return $this->tokens[$offset];
	}
965378
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getUsername();
                break;
            case 2:
                return $this->getPassword();
                break;
            case 3:
                return $this->getSalt();
                break;
            case 4:
                return $this->getFirstname();
                break;
            case 5:
                return $this->getLastname();
                break;
            case 6:
                return $this->getEmail();
                break;
            case 7:
                return $this->getPhone();
                break;
            case 8:
                return $this->getMemo();
                break;
            case 9:
                return $this->getActivated();
                break;
            case 10:
                return $this->getLastLogin();
                break;
            case 11:
                return $this->getNotificationChange();
                break;
            case 12:
                return $this->getNotificationError();
                break;
            default:
                return null;
                break;
        } // switch()
    }
1056143
public function findInTokensByEdge(Tokens $tokens, int $position): ?BlockInfo
    {
        $token = $tokens[$position];

        // shift "array" to "(", event its position
        if ($token->isGivenKind(T_ARRAY)) {
            $position = $tokens->getNextMeaningfulToken($position);
            $token = $tokens[$position];
        }

        if ($token->isGivenKind([T_FUNCTION, CT::T_USE_LAMBDA, T_NEW])) {
            $position = $tokens->getNextTokenOfKind($position, ['(', ';']);
            $token = $tokens[$position];

            // end of line was sooner => has no block
            if ($token->equals(';')) {
                return null;
            }
        }

        // some invalid code
        if ($position === null) {
            return null;
        }

        $blockType = $this->getBlockTypeByToken($token);

        try {
            if (in_array($token->getContent(), $this->startEdges, true)) {
                $blockStart = $position;
                $blockEnd = $tokens->findBlockEnd($blockType, $blockStart);
            } else {
                $blockEnd = $position;
                $blockStart = $tokens->findBlockStart($blockType, $blockEnd);
            }
        } catch (Throwable $throwable) {
            // intentionally, no edge found
            return null;
        }

        return new BlockInfo($blockStart, $blockEnd);
    }