Skip to content

Commit c457713

Browse files
committed
Merge pull request #7 from DataValues/options
Optional options constructor parameter
2 parents 129962e + 0d37402 commit c457713

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ValueFormatters/ValueFormatterBase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ abstract class ValueFormatterBase implements ValueFormatter {
2222
/**
2323
* @since 0.1
2424
*
25-
* @param FormatterOptions $options
25+
* @param FormatterOptions|null $options
2626
*/
27-
public function __construct( FormatterOptions $options ) {
28-
$this->options = $options;
27+
public function __construct( FormatterOptions $options = null ) {
28+
$this->options = $options ?: new FormatterOptions();
2929

3030
$this->options->defaultOption( ValueFormatter::OPT_LANG, 'en' );
3131
}

0 commit comments

Comments
 (0)