Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • PeclUriTemplate
  • UriTemplate

Interfaces

  • UriTemplateInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Parser\UriTemplate;
 4: 
 5: use Guzzle\Common\Exception\RuntimeException;
 6: 
 7: /**
 8:  * Expands URI templates using the uri_template pecl extension (pecl install uri_template-beta)
 9:  *
10:  * @link http://pecl.php.net/package/uri_template
11:  * @link https://github.com/ioseb/uri-template
12:  */
13: class PeclUriTemplate implements UriTemplateInterface
14: {
15:     /**
16:      * Validates that the uri_template extension is installed
17:      * @codeCoverageIgnore
18:      */
19:     public function __construct()
20:     {
21:         if (!extension_loaded('uri_template')) {
22:             throw new RuntimeException('uri_template PECL extension must be installed to use PeclUriTemplate');
23:         }
24:     }
25: 
26:     /**
27:      * {@inheritdoc}
28:      */
29:     public function expand($template, array $variables)
30:     {
31:         return uri_template($template, $variables);
32:     }
33: }
34: 
php-coveralls API documentation generated by ApiGen 2.8.0