Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

add support number of string in __construct of Priority #6145

Closed
wants to merge 1 commit into from
Closed

add support number of string in __construct of Priority #6145

wants to merge 1 commit into from

Conversation

skaic
Copy link
Contributor

@skaic skaic commented Apr 16, 2014

I create a zend_logger from a config.ini, bug it just support return string type. So I add support string in __construct of Priority

@skaic
Copy link
Contributor Author

skaic commented Apr 16, 2014

@weierophinney thinks you for review :)

@Ocramius Ocramius self-assigned this Apr 16, 2014
@Ocramius Ocramius added this to the 2.4.0 milestone Apr 16, 2014
@@ -42,14 +42,14 @@ public function __construct($priority, $operator = null)
$operator = isset($priority['operator']) ? $priority['operator'] : null;
$priority = isset($priority['priority']) ? $priority['priority'] : null;
}
if (!is_int($priority)) {
if (!is_int($priority) && !is_numeric($priority)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is_numeric() also allows hexadecimal, binary, octal values and also exponential parts. I think however you only want to allow numbers. In that case ctype_digit() is a better choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Martin-P oh, I think you are right, thinks :)

@skaic
Copy link
Contributor Author

skaic commented Apr 17, 2014

close adn start anew this PR

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants