AbstractPosition::getVersion

@param string $code

@return string
543872
public function getVersion($codeSerialize)
    {
        $codeMd5 = md5($codeSerialize);

        $strSplit = str_split($codeMd5, 4);
        foreach ($strSplit as $strPart) {
            $strInt[] = str_pad(hexdec($strPart), 5, '0', STR_PAD_LEFT);
        }

        $codeVersion = round(implode('', $strInt), 10);

        return substr_replace($codeVersion, '.', 3, strlen($codeVersion) - 5);
    }
491688
public static function getVersion(string $version = ''): string
    {
        if ($version === '') {
            $version = PrettyVersions::getVersion('api-clients/pusher')->getFullVersion();
        }

        list($version, $hash) = explode('@', $version);

        if (strpos($version, 'dev') !== false) {
            return '0.0.1-' . $hash;
        }

        return $version;
    }
151994
public static function getMessage($code)
    {
        return isset(self::$__messages[$code]) ? self::$__messages[$code] : null;
    }
207180
public function offsetGet($langcode)
    {
        $noDefaultVersion = $this->getDefault() !== $langcode
            and ! isset($this->lang[$this->getDefault()][$this->getCategory()]);
        if (!isset($this->lang[$langcode][$this->getCategory()])) {
            if ($this->isFileExistsInSubDir($langcode)) {
                $this->loadFromFileInSubDir($langcode);
            } elseif ($this->isFileExistsWithSuffix($langcode)) {
                $this->loadFromFileWithSuffix($langcode);
            } elseif ($this->isFileExistsWithoutSuffix($langcode)) {
                $this->loadFromFileWithoutSuffix($langcode);
            } elseif ($noDefaultVersion and $this->isFileExistsInSubDir($this->getDefault())) {
                $langcode = $this->getDefault();
                $this->loadFromFileInSubDir($langcode);
            } elseif ($noDefaultVersion and $this->isFileExistsWithSuffix($this->getDefault())) {
                $langcode = $this->getDefault();
                $this->loadFromFileWithSuffix($langcode);
            } elseif ($noDefaultVersion and $this->isFileExistsWithoutSuffix($this->getDefault())) {
                $langcode = $this->getDefault();
                $this->loadFromFileWithoutSuffix($langcode);
            }
        }

        return $this->lang[$langcode][$this->getCategory()];
    }
891022
public function getConfigurationEntityFromCode($code)
    {
        $dbConfiguration = IndexEngineIndexQuery::create()->findOneByCode($code);

        if (null === $dbConfiguration) {
            throw new InvalidArgumentException(sprintf("The index configuration code '%s' doesn't exist", $code));
        }

        return $this->getConfigurationEntityFromPropelEntity($dbConfiguration);
    }
306984
public function getIso($code = null)
    {
        $data = (array) gplcart_config_get(GC_FILE_CONFIG_CURRENCY);

        if (isset($code)) {
            return isset($data[$code]) ? $data[$code] + array('code' => $code) : array();
        }

        return $data;
    }
778209
protected function getPregErrorText($code = null)
    {
        $code = $code ?: preg_last_error();

        if (!isset(self::$pregErrors[$code])) {
            $code = PREG_NO_ERROR;
        }

        return self::$pregErrors[$code];
    }
171304
public static function message($code)
    {
        if (array_key_exists($code, self::$messages)) {
            return self::$messages[$code];
        }

        return null;
    }
1011557
public function checkCode($code)
    {
        $res = $this->twofactorAdapter->check($code);

        if($res)
        {
            setcookie('twofactorDir-' . $this->dir, $this->cookieCode, 0, "/");
            self::redirect();
        }

        return $res;
    }
992406
private function resolveObject($code)
    {
        $value = $this->resolveCode($code);

        if (!\is_object($value)) {
            throw new RuntimeException('Unable to inspect a non-object');
        }

        return $value;
    }
1042137
public static function getHierarchyLevel($code)
    {
        if ($code === '') {
            return 0;
        }

        $current_length = 0;
        $code_length = strlen($code);
        foreach (static::getHierarchyLengths() as $i => $length) {
            $current_length += $length;
            if ($current_length === $code_length) {
                return $i + 1;
            }
        }

        return -1;
    }
1099426
public function getIso($code = null)
    {
        $data = (array) gplcart_config_get(GC_FILE_CONFIG_COUNTRY);

        if (isset($code)) {
            return isset($data[$code]) ? $data[$code] : '';
        }

        return $data;
    }
436122
static function getUniShip($code)
    {
        static::isValid($code);

        switch ($code) {
            case static::EBP :
                return 'CC';
            case static::GBP :
                return 'FF';
            case static::EP :
            case static::SHD :
            case static::FDF :
                return null;
            case static::BP :
            default:
                return 'AA';
        }
    }
906583
public function withCode(string $code): ViewSource
    {
        $context = clone $this;
        $context->code = $code;

        return $context;
    }
788380
public static function getLanguageForCode($code)
    {
        $language = KlarnaLanguage::fromCode($code);

        if ($language === null) {
            throw new Klarna_UnknownLanguageException($code);
        }
        return $language;
    }
1145117
public static function getStatusMessage($code) {
		if (!$code) {
			return '';
		}

		return isset(self::$statusMessages[$code]) ? self::$statusMessages[$code] : '';
	}
70073
protected function getSafeValue($code)
    {
        if (is_bool($code)) {
            return $code ? '(bool) true' : '(bool) false';
        }

        if (is_scalar($code)) {
            return $code;
        }

        if (is_array($code)) {
            return print_r($code, true);
        }

        return getType($code);
    }