class PeclUriTemplate

Expands URI templates using the uri_template pecl extension (pecl install uri_template-beta)

@link http://pecl.php.net/package/uri_template @link https://github.com/ioseb/uri-template

Hierarchy

Expanded class hierarchy of PeclUriTemplate

File

drupal/core/vendor/guzzle/parser/Guzzle/Parser/UriTemplate/PeclUriTemplate.php, line 13

Namespace

Guzzle\Parser\UriTemplate
View source
class PeclUriTemplate implements UriTemplateInterface {

  /**
   * Validates that the uri_template extension is installed
   * @codeCoverageIgnore
   */
  public function __construct() {
    if (!extension_loaded('uri_template')) {
      throw new RuntimeException('uri_template PECL extension must be installed to use PeclUriTemplate');
    }
  }

  /**
   * {@inheritdoc}
   */
  public function expand($template, array $variables) {
    return uri_template($template, $variables);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PeclUriTemplate::expand public function Expand the URI template using the supplied variables Overrides UriTemplateInterface::expand
PeclUriTemplate::__construct public function Validates that the uri_template extension is installed @codeCoverageIgnore