-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly typed values for "empty()" values [0 | "" | false | null | ...] #77
Conversation
…pe detection inside the function
Types/SqlQuery.php
Outdated
*/ | ||
public static function getStringRepresentation($param) | ||
{ | ||
if (is_int($param) || is_float($param)) |
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.
if (is_int($param) || is_float($param)) return $param;
if (is_numeric($param)) return (float) $param;
if (is_string($param)) return '\'' . $param . '\'';
if ($param === true) return 'true';
if ($param === false) return 'false';
if ($param === null) return 'null';
throw new \Circle\DoctrineRestDriver\Validation\Exceptions\InvalidTypeException('string | int | float | bool | null', '$param', $param);
Hi Nils, thank you for your tremendous work! You fixed a lot of really ugly stuff in a very clear and structured way! May you be so kind and fix these 2 coding style issues I reported via code review? Afterwards this PR is ready to merge. Thanks once again ;) |
Sure, I added another commit. |
Fixes #76
Proposed Changes
extends
of TestCases to work with the default installation via make. Got ClassNotFound Exceptions during testing