-
-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
770a616
to
c08a2b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes needed, bit otherwise seems OK.
My biggest issue with the patch is that, in order to follow consistency with pre-existing code, setters/getters are used to enable this behaviour, instead of relying on the Reader\Ini
constructor.
src/Reader/Ini.php
Outdated
* @param bool $typedMode | ||
* @return $this | ||
*/ | ||
public function setTypedMode($typedMode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just accept bool
as an input (no cast in method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type is to be specified
src/Reader/Ini.php
Outdated
* @see https://www.php.net/parse_ini_file | ||
* @return bool | ||
*/ | ||
public function getTypedMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type to be specified
src/Reader/Ini.php
Outdated
* @see https://www.php.net/parse_ini_file | ||
* @return int | ||
*/ | ||
public function getScannerMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type to be specified
I added the type hinting you requested.
I agree - I was thinking I should add constructor support for all 3 options as a follow-up PR. |
eb278ba
to
fc3c37a
Compare
Signed-off-by: Jonathan Csanyi <jdc@csanyi.ca>
Signed-off-by: Jonathan Csanyi <jdc@csanyi.ca>
fc3c37a
to
3d9852b
Compare
Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
- Removes annotations where typehints exist - Use `self`, not class name as a return type - Indent here/nowdocs (available since PHP 7.3) Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
Description
Adds a
typedMode
flag to the INI Reader to support the built-inINI_SCANNER_TYPED
flag onparse_ini_file()
.This allows integer, boolean, and null values to be returned as the appropriate types, rather than all being returned as strings.