-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitters now allow overriding of parser options.
- Loading branch information
Showing
5 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,13 +64,15 @@ class MimeDir { | |
* Optionally, it's possible to parse the input stream here. | ||
* | ||
* @param resource|null|string $input | ||
* @param int $options Any parser options (OPTION constants). | ||
* @return void | ||
*/ | ||
public function __construct($input = null) { | ||
public function __construct($input = null, $options = 0) { | ||
|
||
if (!is_null($input)) { | ||
$this->setInput($input); | ||
} | ||
$this->options = $options; | ||
|
||
} | ||
|
||
|
@@ -81,10 +83,10 @@ public function __construct($input = null) { | |
* used. | ||
* | ||
* @param string|resource|null $input | ||
* @param int $options | ||
* @param int|null $options | ||
* @return array | ||
*/ | ||
public function parse($input = null, $options = 0) { | ||
public function parse($input = null, $options = null) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
evert
Author
Member
|
||
|
||
$this->root = null; | ||
if (!is_null($input)) { | ||
|
@@ -93,7 +95,7 @@ public function parse($input = null, $options = 0) { | |
|
||
} | ||
|
||
$this->options = $options; | ||
if (!is_null($options)) $this->options = $options; | ||
|
||
$this->parseDocument(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,6 @@ class Version { | |
/** | ||
* Full version number | ||
*/ | ||
const VERSION = '3.0.0-alpha3'; | ||
const VERSION = '3.0.0-alpha4'; | ||
|
||
} |
Why the different defaults in construct and here?