|
@@ -60,7 +60,7 @@ class StubIntlDateFormatter
|
|
|
$this->timetype = $timetype;
|
|
|
|
|
|
$this->setPattern($pattern);
|
|
|
- $this->setTimezoneId($timezone);
|
|
|
+ $this->setTimeZoneId($timezone);
|
|
|
}
|
|
|
|
|
|
public function format($timestamp)
|
|
@@ -215,50 +215,39 @@ class StubIntlDateFormatter
|
|
|
return $formatted;
|
|
|
}
|
|
|
|
|
|
- public function getLocale()
|
|
|
+ public function getCalendar()
|
|
|
{
|
|
|
- return 'en';
|
|
|
+ return self::GREGORIAN;
|
|
|
}
|
|
|
|
|
|
- public function setLocale($locale)
|
|
|
+ public function getDateType()
|
|
|
{
|
|
|
- throw new MethodNotImplementedException(__METHOD__);
|
|
|
+ return $this->datetype;
|
|
|
}
|
|
|
|
|
|
- public function getPattern()
|
|
|
+ public function setLocale($locale)
|
|
|
{
|
|
|
- return $this->pattern;
|
|
|
+ throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function setPattern($pattern)
|
|
|
+ public function getErrorCode()
|
|
|
{
|
|
|
- if (null === $pattern) {
|
|
|
- $patternParts = array();
|
|
|
- if (self::NONE !== $this->datetype) {
|
|
|
- $patternParts[] = $this->defaultDateFormats[$this->datetype];
|
|
|
- }
|
|
|
- if (self::NONE !== $this->timetype) {
|
|
|
- $patternParts[] = $this->defaultTimeFormats[$this->timetype];
|
|
|
- }
|
|
|
- $pattern = implode(' ', $patternParts);
|
|
|
- }
|
|
|
-
|
|
|
- $this->pattern = $pattern;
|
|
|
+ throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function getCalendar()
|
|
|
+ public function getErrorMessage()
|
|
|
{
|
|
|
- return self::GREGORIAN;
|
|
|
+ throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function setCalendar()
|
|
|
+ public function getLocale()
|
|
|
{
|
|
|
- throw new MethodNotImplementedException(__METHOD__);
|
|
|
+ return 'en';
|
|
|
}
|
|
|
|
|
|
- public function getDateType()
|
|
|
+ public function getPattern()
|
|
|
{
|
|
|
- return $this->datetype;
|
|
|
+ return $this->pattern;
|
|
|
}
|
|
|
|
|
|
public function getTimeType()
|
|
@@ -266,43 +255,59 @@ class StubIntlDateFormatter
|
|
|
return $this->timetype;
|
|
|
}
|
|
|
|
|
|
- public function getErrorCode()
|
|
|
+ public function getTimeZoneId()
|
|
|
{
|
|
|
- throw new MethodNotImplementedException(__METHOD__);
|
|
|
+ return $this->dateTimeZone->getName();
|
|
|
}
|
|
|
|
|
|
- public function getErrorMessage()
|
|
|
+ public function isLenient()
|
|
|
{
|
|
|
throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function getTimezoneId()
|
|
|
+ public function localtime($value, &$position = 0)
|
|
|
{
|
|
|
- return $this->dateTimeZone->getName();
|
|
|
+ throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function setTimezoneId($timezoneId)
|
|
|
+ public function parse($value, &$position = 0)
|
|
|
{
|
|
|
- try {
|
|
|
- $this->dateTimeZone = new \DateTimeZone($timezoneId);
|
|
|
- } catch (\Exception $e) {
|
|
|
- $this->dateTimeZone = new \DateTimeZone('UTC');
|
|
|
- }
|
|
|
+ throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function isLenient()
|
|
|
+ public function setCalendar()
|
|
|
{
|
|
|
throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function localtime($value, &$position = 0)
|
|
|
+ public function setLenient($lenient)
|
|
|
{
|
|
|
throw new MethodNotImplementedException(__METHOD__);
|
|
|
}
|
|
|
|
|
|
- public function parse($value, &$position = 0)
|
|
|
+ public function setPattern($pattern)
|
|
|
{
|
|
|
- throw new MethodNotImplementedException(__METHOD__);
|
|
|
+ if (null === $pattern) {
|
|
|
+ $patternParts = array();
|
|
|
+ if (self::NONE !== $this->datetype) {
|
|
|
+ $patternParts[] = $this->defaultDateFormats[$this->datetype];
|
|
|
+ }
|
|
|
+ if (self::NONE !== $this->timetype) {
|
|
|
+ $patternParts[] = $this->defaultTimeFormats[$this->timetype];
|
|
|
+ }
|
|
|
+ $pattern = implode(' ', $patternParts);
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->pattern = $pattern;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setTimeZoneId($timeZoneId)
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $this->dateTimeZone = new \DateTimeZone($timeZoneId);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $this->dateTimeZone = new \DateTimeZone('UTC');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static public function create($locale, $datetype, $timetype, $timezone = null, $calendar = null, $pattern = null)
|