예제 #1
0
 /**
  * Converts a value from its database representation to its PHP representation
  *
  * @param mixed            $value    The value to convert
  * @param AbstractPlatform $platform The currently used database platform
  *
  * @return mixed
  *
  * @throws ConversionException When the conversion fails
  */
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     if (empty($value)) {
         return null;
     }
     if ($value instanceof Url) {
         return $value;
     }
     try {
         $url = Url::parse($value);
     } catch (Exception $exception) {
         throw ConversionException::conversionFailed($value, static::TYPE_NAME);
     }
     return $url;
 }
예제 #2
0
파일: UrlTest.php 프로젝트: novuso/common-l
 public function test_that_query_is_normalized_and_ordered_by_key()
 {
     $url1 = Url::parse('https://app.dev?one=two&foo=bar&key=value&=nokey');
     $url2 = Url::parse('https://app.dev?key=value&one=two&foo=bar&');
     $this->assertTrue($url1->equals($url2));
 }