Skip to content
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

Add name converters between Generic converters #14

Closed
AlexSkrypnyk opened this issue May 29, 2024 · 0 comments · Fixed by #15
Closed

Add name converters between Generic converters #14

AlexSkrypnyk opened this issue May 29, 2024 · 0 comments · Fixed by #15

Comments

@AlexSkrypnyk
Copy link
Owner

AlexSkrypnyk commented May 29, 2024

Add methods for all Generic conversions (42 in total).

The converters are NOT strict. This means, that ::strict() should not be used.

Here is the table with the conversion names and corresponding numbers:

Number Conversion Name
1 snake2camel
2 snake2pascal
3 snake2kebab
4 snake2train
5 snake2flat
6 snake2cobol
7 camel2snake
8 camel2pascal
9 camel2kebab
10 camel2train
11 camel2flat
12 camel2cobol
13 pascal2snake
14 pascal2camel
15 pascal2kebab
16 pascal2train
17 pascal2flat
18 pascal2cobol
19 kebab2snake
20 kebab2camel
21 kebab2pascal
22 kebab2train
23 kebab2flat
24 kebab2cobol
25 train2snake
26 train2camel
27 train2pascal
28 train2kebab
29 train2flat
30 train2cobol
31 flat2snake
32 flat2camel
33 flat2pascal
34 flat2kebab
35 flat2train
36 flat2cobol
37 cobol2snake
38 cobol2camel
39 cobol2pascal
40 cobol2kebab
41 cobol2train
42 cobol2flat

Add these converters after public static function flat(string $string): string {

Use the same format to test

/**
 * @from I-Am-A--String-With-Sp@ce¥s-14-And-😀-Unicode-Élève
 * @to i_am_a__string_with_sp@ce¥s_14_and_😀_unicode_élève
 */
 public static function train2snake(string $string): string {
  // code here
 }
AlexSkrypnyk added a commit that referenced this issue May 30, 2024
Co-authored-by: Tan Nguyen <raucaixanh04@gmail.com>
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 a pull request may close this issue.

1 participant