     1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

    <?php
    /**
     * @type Callback
     *
     * Catapult callbacks
     */
    namespace Catapult;
    final class Callback extends Types {
        public function __construct($callback='')
        {
          if (!(filter_var($callback, FILTER_VALIDATE_URL)))
            Throw new \CatapultApiException("Callback is not a valid URL..");

          $this->callback = $callback;
        }

        /** todo add RFC3986 encoding only on query string. **/
        public function __toString()
        {
          return $this->callback;
        }
    }