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

Bug in Underscore Namingstrategy #101

Closed
wants to merge 1 commit into from
Closed

Bug in Underscore Namingstrategy #101

wants to merge 1 commit into from

Conversation

boesing
Copy link
Member

@boesing boesing commented Mar 14, 2019

Hey guys,

in v2, the failing unit test worked as expected.
Since v3, the CamelCaseToUnderscoreFilter adds various underscores around the numeric values within a string.

Any suggestion how this can be fixed without breaking the other tests?

And why was that behavior changed that much?
CamelCaseToSeparator of zend-filter works a lot different than the new logic.

I dont even get the new logic:

-'bfd7b82e9cfceaa82704d1c1_foo'
+'bfd_7_b82e_9_cfceaa_82704_d1c_1_foo'

So why the string is being separated with _ after bfd and not after bfd7b again? x_O

@weierophinney
Copy link
Member

I dont even get the new logic:

-'bfd7b82e9cfceaa82704d1c1_foo'
+'bfd_7_b82e_9_cfceaa_82704_d1c_1_foo'

So why the string is being separated with _ after bfd and not after bfd7b again? x_O

It looks like it's separating at numeric boundaries... but, honestly, if that were 100% the case, I'd expect bfd_7_b_82_e_9_cfceaa_82704_d_1_c_1_foo.

What happened for v3 was that we brought the filters into the package, to remove the dependency on zend-filter. It looks like there are differences between zend-filter and what we do here, though, so I'll review the two side-by-side to figure out how and why, and fix it.

Thanks for the failing test!

@boesing
Copy link
Member Author

boesing commented Mar 14, 2019

It looks like it's separating at numeric boundaries... but, honestly, if that were 100% the case, I'd expect bfd_7_b_82_e_9_cfceaa_82704_d_1_c_1_foo.

Thats exactly what I thought, yup.

@weierophinney
Copy link
Member

@boesing Can you enable maintainer push rights on your fork? I have a patch I've built against your branch that contains a fix, and I'd like to push back to your branch.

Thanks!

@boesing
Copy link
Member Author

boesing commented Mar 15, 2019

@weierophinney edits from maintainers are enabled in this PR or do I have to do anything else?

@michalbundyra
Copy link
Member

@boesing On the side in your PR just check the checkbox:

image

@boesing
Copy link
Member Author

boesing commented Mar 15, 2019

@boesing On the side in your PR just check the checkbox:

image

Thats already activated.
image

@weierophinney
Copy link
Member

Really strange - it won't let me push, citing access rights.

I'll push to my own branch and open a new PR, closing this one.

@weierophinney
Copy link
Member

#103 builds on your tests; thanks, @boesing !

@boesing boesing deleted the bugfix/underscore-naming-strategy branch March 15, 2019 16:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants