Skip to content

Missing type in RegexConverter #46

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

Closed
wants to merge 1 commit into from
Closed

Missing type in RegexConverter #46

wants to merge 1 commit into from

Conversation

rklak
Copy link

@rklak rklak commented Jan 7, 2015

We have used type null, and after update to 1.1.4 we get an Exception.

We have used type null, and after update to 1.1.4 we get an Exception.
@@ -19,6 +19,8 @@ public function toRegex(TypePattern $type)
return "(\\-?[0-9]*)";
case 'double':
return "(\\-?[0-9]*[\\.|\\,][0-9]*)";
case 'null':
return "(null|NULL)";
Copy link
Member

Choose a reason for hiding this comment

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

I guess it have no sense to match "lorem ipsum null" against pattern "lorem ipsum @null@" in texts, maybe instead of supporting @null@ type matcher we could handle UnknownTypeException in TextMatcher and fail matching when this exception is throwed with error message that "@null@ type matcher is not supported in text matching".
What do you think @rklak ?

Copy link
Author

Choose a reason for hiding this comment

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

It's good, but with this change project was switched from 1.1.x to 1.1.4 - I think it was too big refactor to switch only the last number in version. It should be in 1.2 so when we've updated in project this library with 1.1.* format in our composer now we got an Exception.

Null is useless, thats true, so we will remove it from our mocks... but as I said - too big change for the last number :)

You probably now this: http://semver.org/
3. PATCH version when you make backwards-compatible bug fixes.

@norberttech
Copy link
Member

As adding @null@ type pattern to the TextMatcher have no sense I have added catching UnknownTypeExcetption which is later turned into error. For more informations check #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants