/** * @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); }
/** * @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; }
/** * @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); }
/** * @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); }
/** * @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); }
/** * @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, ','); }
/** * @param EntityIdParser $parser */ public function __construct(EntityIdParser $parser) { parent::__construct(); $this->parser = $parser; }
/** * @param ParserOptions|null $options */ public function __construct(ParserOptions $options = null) { parent::__construct($options); $this->defaultOption(self::OPT_GLOBE, 'http://www.wikidata.org/entity/Q2'); }
/** * @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(); }
/** * @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(); }
/** * @param ParserOptions|null $options */ public function __construct(ParserOptions $options = null) { parent::__construct($options); $this->defaultOption(self::OPT_CALENDAR_MODEL_URIS, array()); }