/** * @return string */ public function toString() { if (null !== $this->tag) { return $this->curie->toString() . ':' . $this->id . '#' . $this->tag; } return $this->curie->toString() . ':' . $this->id; }
/** * Returns the fully qualified php class name to be used for the provided curie. * * @param SchemaCurie $curie * @return string * @throws NoMessageForCurie */ public static function resolveCurie(SchemaCurie $curie) { $key = $curie->toString(); if (isset(self::$resolved[$key])) { return self::$resolved[$key]; } if (isset(self::$messages[$key])) { $className = self::$messages[$key]; self::$resolved[$key] = $className; return $className; } throw new NoMessageForCurie($curie); }
/** * @param SchemaCurie $curie */ public function __construct(SchemaCurie $curie) { $this->curie = $curie; parent::__construct(sprintf('MessageResolver is unable to resolve [%s] to a class name.', $curie->toString())); }