private function validateUid($uid)
    {
        if (!is_string($uid)) {
            throw new TokenException(sprintf('The uid must be a string, %s given.', gettype($uid)));
        }

        $uidSize = mb_strlen($uid, '8bit');

        if ($uidSize > static::MAX_UID_SIZE) {
            throw new TokenException(
                sprintf('The provided uid is longer than %d bytes (%d).', static::MAX_UID_SIZE, $uidSize)
            );
        }

        if (0 === $uidSize) {
            throw new TokenException('The provided uid is empty.');
        }
    }
private function validateUid($uid)
    {
        if (!is_string($uid)) {
            throw new TokenException(sprintf('The uid must be a string, %s given.', gettype($uid)));
        }

        $uidSize = mb_strlen($uid, '8bit');

        if ($uidSize > static::MAX_UID_SIZE) {
            throw new TokenException(
                sprintf('The provided uid is longer than %d bytes (%d).', static::MAX_UID_SIZE, $uidSize)
            );
        }

        if (0 === $uidSize) {
            throw new TokenException('The provided uid is empty.');
        }
    }
private function validateUid ( $ uid ) { if ( ! is_string ( $ uid ) ) { throw new TokenException ( sprintf ( 'The uid must be a string, %s given.' , gettype ( $ uid ) ) ) ; } $ uidSize = mb_strlen ( $ uid , '8bit' ) ; if ( $ uidSize > static :: MAX_UID_SIZE ) { throw new TokenException ( sprintf ( 'The provided uid is longer than %d bytes (%d).' , static :: MAX_UID_SIZE , $ uidSize ) ) ; } if ( 0 === $ uidSize ) { throw new TokenException ( 'The provided uid is empty.' ) ; } }
Validates an uid.

@param string $uid The uid.

@throws TokenException If the uid is invalid.
Validates an uid .