/**
  * @param ValueParser|null $eraParser
  * @param ParserOptions|null $options
  */
 public function __construct(ValueParser $eraParser = null, ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_DIGIT_GROUP_SEPARATOR, self::CANONICAL_DIGIT_GROUP_SEPARATOR);
     $this->eraParser = $eraParser ?: new EraParser($this->options);
     $this->isoTimestampParser = new IsoTimestampParser(new CalendarModelParser($this->options), $this->options);
 }
Ejemplo n.º 2
0
 /**
  * @param MonthNameUnlocalizer $monthNameUnlocalizer Used to translate month names to English,
  * the language PHP's DateTime parser understands.
  * @param ValueParser $eraParser String parser that detects signs, "BC" suffixes and such and
  * returns an array with the detected sign character and the remaining value.
  * @param ValueParser $isoTimestampParser String parser that gets a language independend
  * YMD-ordered timestamp and returns a TimeValue object. Used for precision detection.
  */
 public function __construct(MonthNameUnlocalizer $monthNameUnlocalizer, ValueParser $eraParser, ValueParser $isoTimestampParser)
 {
     parent::__construct();
     $this->monthNameUnlocalizer = $monthNameUnlocalizer;
     $this->eraParser = $eraParser;
     $this->isoTimestampParser = $isoTimestampParser;
 }
Ejemplo n.º 3
0
 /**
  * @param CalendarModelParser|null $calendarModelParser
  * @param ParserOptions|null $options
  */
 public function __construct(CalendarModelParser $calendarModelParser = null, ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_CALENDAR, null);
     $this->defaultOption(self::OPT_PRECISION, null);
     $this->calendarModelParser = $calendarModelParser ?: new CalendarModelParser($this->options);
 }
Ejemplo n.º 4
0
 /**
  * @since 0.1
  *
  * @param ParserOptions|null $options
  * @param NumberUnlocalizer $unlocalizer
  */
 public function __construct(ParserOptions $options = null, NumberUnlocalizer $unlocalizer = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_UNIT, null);
     $this->unlocalizer = $unlocalizer ?: new BasicNumberUnlocalizer();
     $this->decimalParser = new DecimalParser($this->options, $this->unlocalizer);
 }
Ejemplo n.º 5
0
 /**
  * @param ValueParser|null $eraParser
  * @param ParserOptions|null $options
  */
 public function __construct(ValueParser $eraParser = null, ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->lang = Language::factory($this->getOption(ValueParser::OPT_LANG));
     $this->eraParser = $eraParser ?: new EraParser($this->options);
     $this->isoTimestampParser = new IsoTimestampParser(new CalendarModelParser($this->options), $this->options);
 }
 /**
  * @see StringValueParser::__construct
  */
 public function __construct(ParserOptions $options = null)
 {
     parent::__construct($options);
     $languageCode = $this->getOption(ValueParser::OPT_LANG);
     $this->monthNameUnlocalizations = $this->getMonthNameUnlocalizations($languageCode);
     $this->isoTimestampParser = new IsoTimestampParser(new CalendarModelParser($this->options), $this->options);
 }
Ejemplo n.º 7
0
 /**
  * @since 0.1
  *
  * @param ParserOptions|null $options
  */
 public function __construct(ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_NORTH_SYMBOL, 'N');
     $this->defaultOption(self::OPT_EAST_SYMBOL, 'E');
     $this->defaultOption(self::OPT_SOUTH_SYMBOL, 'S');
     $this->defaultOption(self::OPT_WEST_SYMBOL, 'W');
     $this->defaultOption(self::OPT_SEPARATOR_SYMBOL, ',');
 }
Ejemplo n.º 8
0
 /**
  * @param EntityIdParser $parser
  */
 public function __construct(EntityIdParser $parser)
 {
     parent::__construct();
     $this->parser = $parser;
 }
Ejemplo n.º 9
0
 /**
  * @param ParserOptions|null $options
  */
 public function __construct(ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_GLOBE, 'http://www.wikidata.org/entity/Q2');
 }
Ejemplo n.º 10
0
 /**
  * @param ValueParser $eraParser String parser that detects signs, "BC" suffixes and such and
  * returns an array with the detected sign character and the remaining value.
  */
 public function __construct(ValueParser $eraParser = null)
 {
     parent::__construct();
     $this->eraParser = $eraParser ?: new EraParser();
 }
Ejemplo n.º 11
0
 /**
  * @since 0.1
  *
  * @param ParserOptions|null $options
  * @param NumberUnlocalizer|null $unlocalizer
  */
 public function __construct(ParserOptions $options = null, NumberUnlocalizer $unlocalizer = null)
 {
     parent::__construct($options);
     $this->unlocalizer = $unlocalizer ?: new BasicNumberUnlocalizer();
 }
Ejemplo n.º 12
0
 /**
  * @param ParserOptions|null $options
  */
 public function __construct(ParserOptions $options = null)
 {
     parent::__construct($options);
     $this->defaultOption(self::OPT_CALENDAR_MODEL_URIS, array());
 }