@param array  $options
@param string $code

@return string
18337
public static function invoke(
        array $options,
        string $code
    ): string {
        $codes = Property::getArray(
            $options,
            self::OPTION_CODES,
            null
        );

        if (empty($codes)) {
            return $code;
        }

        return Property::getString(
            $codes,
            $code,
            $code
        );
    }
229956
public static function toMessage($code)
    {
        return isset(self::$message[$code]) ? self::$message[$code] : $code;
    }
665819
public static function convertToJSON($bencode, $options = 0)
    {
        $object = self::decode($bencode);
        $json = json_encode($object, $options);

        return $json;
    }
1162996
protected function filtreCode($code)
    {
        if (is_numeric($code)) {
            $code = (int) $code;
        }
        if (!isset($this->reasonPhraseDefault[ $code ])) {
            throw new \InvalidArgumentException('Status code is invalid.');
        }

        return $code;
    }
592475
public static function shortCodeCodepen($options)
    {
        $options= array_merge(
            [
                "id"    => null,
                "class" => null,
                "src" => null,
                "user" => null,
                "title" => null,
                "tab" => "result",
                "theme" => 0,
                "height" => 300,
                "width" => "100%",
                "caption" => null,
            ],
            self::ShortCodeInit($options)
        );
        extract($options, EXTR_SKIP);

        $id = $id ? " id=\"$id\"" : null;
        $class = $class ? " class=\"figure figure-codepen $class\"" : " class=\"figure figure-codepen\"";

        //$caption = t("Figure: !CAPTION", ["!CAPTION" => $caption]);
        if ($caption) {
            $caption = "<figcaption markdown=1>{$caption}</figcaption>";
        }

        // @codingStandardsIgnoreStart
        $html = <<<EOD
<figure{$id}{$class} width="$width">
<p data-height="$height" data-theme-id="$theme" data-slug-hash="$src" data-default-tab="$tab" data-user="$user" data-embed-version="2" data-pen-title="$title" class="codepen">See the <a href="https://codepen.io/$user/pen/$src/">Pen</a> on <a href="https://codepen.io">CodePen</a>.</p>
{$caption}
</figure>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
EOD;
        // @codingStandardsIgnoreEnd

        return $html;
    }
984391
protected function getTokenUrl($code) {
		return $this->providerOptions['access_token'] . '?client_id=' . $this->client_id . '&client_secret=' . $this->client_secret . '&code=' . $code . '&redirect_uri=' . urlencode($this->getState('redirect_uri'));
	}
560483
public function respond(array $data, $status = 200, $code, array $headers = [], $options = 0)
    {
        return $this->response->json(
            array_merge(compact('status', 'code'), $data), $status, $headers, $options
        );
    }
1166759
private function codeMessage($code)
    {
        // 在控制器中定义code属性后，会优先使用业务定义的代码，否则使用系统定义码
        $codes = $this->code;
        if (isset($codes::$msg[$code])) {
            return $codes::$msg[$code];
        }

        if (isset(Code::$msg[$code])) {
            return Code::$msg[$code];
        }

        return $this->codeMessage(Code::UNDEFINED_ERROR);
    }
816869
public function addCss($styleCode, array $options = [])
    {
        if (!isset($options['position'])) {
            $options['position'] = self::POS_HEAD;
        }

        return $this->loggingCodeAsset($styleCode, self::ASSET_CSS, $options);
    }
823824
public static function code($code = 200) : String
    {
        $messages = Datatype::multikey(self::$messages);

        if( isset($messages[$code]) )
        {
            return $messages[$code];
        }

        return false;
    }
287466
public static function getDescription($code)
    {
        if (array_key_exists($code, self::$codes_to_string_map)) {
            return self::$codes_to_string_map[$code];
        } else {
            return false;
        }
    }
1265451
private function resolveOptions($string, array $options)
    {
        foreach ($options as $key => $value) {
            $string = str_replace(':' . $key, $value, $string);
        }

        return $string;
    }
862812
public function oauth($code)
    {
        $options = [
            'grant_type' => 'authorization_code',
            'client_id' => $this->app->getId(),
            'client_secret' => $this->app->getSecret(),
            'redirect_uri' => $this->getCallbackUrl(),
            'code' => $code,
            'state' => $this->state,
        ];

        $response = HelperFactory::getInstance()->request($this->client, Constants::API_TOKEN, $options, 'POST');

        $this->oauthResponse = new InstagramOAuth(
            json_decode($response->getBody()->getContents())
        );

        return $this->oauthResponse;
    }
1216019
public function token($code) {
        if (!is_array($code)) {
            $code = [
                'code' => $code,
            ];
        }
        return $this->getToken()->parameters($code)->text();
    }
612112
private function getOption($option, array $options)
    {
        return isset($options[$option]) ? $options[$option] : $this->$option;
    }
535897
public function code ( $code = NULL ) {
      if ( $code === NULL )
        return $this->code;
      if ( ResponseCode::find( $code ) === NULL )
        throw new \InvalidArgumentException( "Response: no code $code" );
      $this->code = intval( $code );
      return $this;
    }
802861
public function get($code = null): string
    {
        if (!$this->validate($code)) {
            throw new \InvalidArgumentException('Invalid code');
        }

        return isset(self::$codes[$code]) ? self::$codes[$code] : '';
    }