@param Teaser $teaser
@param int    $version
@param string $language

@return string
976916
public function hashTeaser(Teaser $teaser, $version, $language)
    {
        $identifier = "{$teaser->getId()}__{$version}__{$language}";

        if (isset($this->hashes[$identifier])) {
            return $this->hashes[$identifier];
        }

        $values = $this->createHashValuesByTeaser($teaser, $version, $language);
        $hash = $this->hashValues($values);

        $this->hashes[$identifier] = $hash;

        return $hash;
    }
947042
public static function build($name, $version, $description)
    {
        $api = new static();
        $api->name = $name;
        $api->apiVersion = $version;
        $api->description = $description;

        return $api;
    }
334252
public function getLanguageCode($lang = null)
    {
        $parts = $this->_callInternalLocale('parseLocale', null, $lang, false);
        return isset($parts['language']) ? $parts['language'] : null;
    }
734855
public function getChildrenQueryBuilder(Node $parent, $lang = null)
    {
        return $this->getNodeTranslationsQueryBuilder($lang)
            ->andWhere('n.parent = :parent')
            ->setParameter('parent', $parent);
    }
1107840
public function getNodeTranslationsQueryBuilder($lang = null)
    {
        $queryBuilder = $this->createQueryBuilder('nt')
            ->select('nt,n,v')
            ->innerJoin('nt.node', 'n')
            ->leftJoin(
                'nt.publicNodeVersion',
                'v',
                'WITH',
                'nt.publicNodeVersion = v.id'
            )
            ->where('n.deleted = false')
            ->orderBy('nt.weight')
            ->addOrderBy('nt.weight');

        if (!empty($lang)) {
            $queryBuilder
                ->andWhere('nt.lang = :lang')
                ->setParameter('lang', $lang);
        }

        return $queryBuilder;
    }
1175013
public static function getStaticItems( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_ITEMS, null, $locale, $version);
		return self::loadStaticData($url);
	}
311387
protected static function extractVersion(string $version, string $expression): ?string
    {
        if (preg_match($expression, $version, $result)) {
            return Arr::first($result);
        }

        return null;
    }
1338915
public static function createFrame($version)
    {
        $width = self::$capacity[$version][Constants::QRCAP_WIDTH];
        $frameLine = str_repeat ("\0", $width);
        $frame = array_fill(0, $width, $frameLine);

        // Finder pattern
        self::putFinderPattern($frame, 0, 0);
        self::putFinderPattern($frame, $width - 7, 0);
        self::putFinderPattern($frame, 0, $width - 7);

        // Separator
        $yOffset = $width - 7;

        for($y=0; $y<7; $y++) {
            $frame[$y][7] = "\xc0";
            $frame[$y][$width - 8] = "\xc0";
            $frame[$yOffset][7] = "\xc0";
            $yOffset++;
        }

        $setPattern = str_repeat("\xc0", 8);

        QRstr::set($frame, 0, 7, $setPattern);
        QRstr::set($frame, $width-8, 7, $setPattern);
        QRstr::set($frame, 0, $width - 8, $setPattern);

        // Format info
        $setPattern = str_repeat("\x84", 9);
        QRstr::set($frame, 0, 8, $setPattern);
        QRstr::set($frame, $width - 8, 8, $setPattern, 8);

        $yOffset = $width - 8;

        for($y=0; $y<8; $y++,$yOffset++) {
            $frame[$y][8] = "\x84";
            $frame[$yOffset][8] = "\x84";
        }

        // Timing pattern

        for($i=1; $i<$width-15; $i++) {
            $frame[6][7+$i] = chr(0x90 | ($i & 1));
            $frame[7+$i][6] = chr(0x90 | ($i & 1));
        }

        // Alignment pattern
        self::putAlignmentPattern($version, $frame, $width);

        // Version information
        if($version >= 7) {
            $vinf = self::getVersionPattern($version);

            $v = $vinf;

            for($x=0; $x<6; $x++) {
                for($y=0; $y<3; $y++) {
                    $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1));
                    $v = $v >> 1;
                }
            }

            $v = $vinf;
            for($y=0; $y<6; $y++) {
                for($x=0; $x<3; $x++) {
                    $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1));
                    $v = $v >> 1;
                }
            }
        }

        // and a little bit...
        $frame[$width - 8][8] = "\x81";

        return $frame;
    }
1046608
public function createDeprecatedTag($version = null, $description = null)
    {
        return $this->internalCreateTag(true, 'deprecated', $version, $description);
    }
89871
public static function getStaticReforgedRunes( string $locale = 'en_US', string $version = null ) : array
	{
		$url = self::getStaticDataFileUrl(self::STATIC_RUNESREFORGED, null, $locale, $version);
		return self::loadStaticData($url);
	}
202610
public function getCharacterCountBits(Version $version) : int
    {
        $number = $version->getVersionNumber();

        if ($number <= 9) {
            $offset = 0;
        } elseif ($number <= 26) {
            $offset = 1;
        } else {
            $offset = 2;
        }

        return $this->characterCountBitsForVersions[$offset];
    }
1164788
protected function getSinceUntilRegExp($sinceVersion, $untilVersion)
    {
        $sinceVersion = str_pad($sinceVersion, 3, '.0');
        $untilVersion = str_pad($untilVersion, 3, '.0');

        if (! ($sinceVersion < $untilVersion)) {
            throw new \LogicException('since must be lesser than until');
        }

        if ($sinceVersion[0] === $untilVersion[0]) {
            return sprintf(
                '(?:%d\.[%d-%d])',
                $sinceVersion[0],
                $sinceVersion[2],
                $untilVersion[2]
            );
        } elseif (abs($sinceVersion[0] - $untilVersion[0]) === 1) {
            return sprintf(
                '(?:%d\.[%d-9])|(?:%d\.[0-%d])',
                $sinceVersion[0],
                $sinceVersion[2],
                $untilVersion[0],
                $untilVersion[2]
            );
        } else {
            return sprintf(
                '(?:%d\.[%d-9])|(?:%d\.[0-%d])|(?:[%d-%d]\.\d)',
                $sinceVersion[0],
                $sinceVersion[2],
                $untilVersion[0],
                $untilVersion[2],
                9 < $sinceVersion[0] + 1 ? 9 : $sinceVersion[0] + 1,
                0 > $untilVersion[0] - 1 ? 0 : $untilVersion[0] - 1
            );
        }
    }
264972
public function encodeModeKanji($version)
    {
        try {

            $bs = new QRbitstream();

            $bs->appendNum(4, 0x8);
            $bs->appendNum(QRspec::lengthIndicator(Constants::QR_MODE_KANJI, $version), (int)($this->size / 2));

            for($i=0; $i<$this->size; $i+=2) {
                $val = (ord($this->data[$i]) << 8) | ord($this->data[$i+1]);
                if($val <= 0x9ffc) {
                    $val -= 0x8140;
                } else {
                    $val -= 0xc140;
                }

                $h = ($val >> 8) * 0xc0;
                $val = ($val & 0xff) + $h;

                $bs->appendNum(13, $val);
            }

            $this->bstream = $bs;
            return 0;

        } catch (Exception $e) {
            return -1;
        }
    }
559799
private static function _versionToEKB(int $version): int
    {
        static $lut;
        if ($version > 255) {
            return $version;
        }
        if (!isset($lut)) {
            $lut = array_flip(self::EKB_TABLE);
        }
        return $lut[$version];
    }
560701
public function writeVersion(Version $version)
    {
        $cacheItem = $this->cache->getItem('version');
        $cacheItem->set($version);

        $this->cache->save($cacheItem);
        $this->writer->write($version);
    }
1204432
protected function prepareSection($version, $page)
    {
        if ($this->documentation->sectionExists($version, $page)) {
            $this->currentSection = '/'.$page;
        }

        return $this;
    }
834729
public static function toString(Version $version)
    {
        return sprintf(
            '%d.%d.%d%s%s',
            $version->getMajor(),
            $version->getMinor(),
            $version->getPatch(),
            $version->getPreRelease()
                ? '-' . join('.', $version->getPreRelease())
                : '',
            $version->getBuild()
                ? '+' . join('.', $version->getBuild())
                : ''
        );
    }