@@ -19,163 +19,147 @@ class NormaliseTest extends TestCase
19
19
/**
20
20
* Method to seed data to testFromCamelCase.
21
21
*
22
- * @return array
22
+ * @return \Generator
23
23
*
24
24
* @since 1.0
25
25
*/
26
- public function seedTestFromCamelCase ()
26
+ public function seedTestFromCamelCase (): \ Generator
27
27
{
28
- return array (
29
- // Note: string, expected
30
- array ('FooBarABCDef ' , array ('Foo ' , 'Bar ' , 'ABC ' , 'Def ' )),
31
- array ('JFooBar ' , array ('J ' , 'Foo ' , 'Bar ' )),
32
- array ('J001FooBar002 ' , array ('J001 ' , 'Foo ' , 'Bar002 ' )),
33
- array ('abcDef ' , array ('abc ' , 'Def ' )),
34
- array ('abc_defGhi_Jkl ' , array ('abc_def ' , 'Ghi_Jkl ' )),
35
- array ('ThisIsA_NASAAstronaut ' , array ('This ' , 'Is ' , 'A_NASA ' , 'Astronaut ' )),
36
- array ('JohnFitzgerald_Kennedy ' , array ('John ' , 'Fitzgerald_Kennedy ' )),
37
- );
28
+ // Note: string, expected
29
+ yield ['FooBarABCDef ' , ['Foo ' , 'Bar ' , 'ABC ' , 'Def ' ]];
30
+ yield ['JFooBar ' , ['J ' , 'Foo ' , 'Bar ' ]];
31
+ yield ['J001FooBar002 ' , ['J001 ' , 'Foo ' , 'Bar002 ' ]];
32
+ yield ['abcDef ' , ['abc ' , 'Def ' ]];
33
+ yield ['abc_defGhi_Jkl ' , ['abc_def ' , 'Ghi_Jkl ' ]];
34
+ yield ['ThisIsA_NASAAstronaut ' , ['This ' , 'Is ' , 'A_NASA ' , 'Astronaut ' ]];
35
+ yield ['JohnFitzgerald_Kennedy ' , ['John ' , 'Fitzgerald_Kennedy ' ]];
38
36
}
39
37
40
38
/**
41
39
* Method to seed data to testFromCamelCase.
42
40
*
43
- * @return array
41
+ * @return \Generator
44
42
*
45
43
* @since 1.0
46
44
*/
47
- public function seedTestFromCamelCase_nongrouped ()
45
+ public function seedTestFromCamelCase_nongrouped (): \ Generator
48
46
{
49
- return array (
50
- array ('Foo Bar ' , 'FooBar ' ),
51
- array ('foo Bar ' , 'fooBar ' ),
52
- array ('Foobar ' , 'Foobar ' ),
53
- array ('foobar ' , 'foobar ' )
54
- );
47
+ yield ['Foo Bar ' , 'FooBar ' ];
48
+ yield ['foo Bar ' , 'fooBar ' ];
49
+ yield ['Foobar ' , 'Foobar ' ];
50
+ yield ['foobar ' , 'foobar ' ];
55
51
}
56
52
57
53
/**
58
54
* Method to seed data to testToCamelCase.
59
55
*
60
- * @return array
56
+ * @return \Generator
61
57
*
62
58
* @since 1.0
63
59
*/
64
- public function seedTestToCamelCase ()
60
+ public function seedTestToCamelCase (): \ Generator
65
61
{
66
- return array (
67
- array ('FooBar ' , 'Foo Bar ' ),
68
- array ('FooBar ' , 'Foo-Bar ' ),
69
- array ('FooBar ' , 'Foo_Bar ' ),
70
- array ('FooBar ' , 'foo bar ' ),
71
- array ('FooBar ' , 'foo-bar ' ),
72
- array ('FooBar ' , 'foo_bar ' ),
73
- );
62
+ yield ['FooBar ' , 'Foo Bar ' ];
63
+ yield ['FooBar ' , 'Foo-Bar ' ];
64
+ yield ['FooBar ' , 'Foo_Bar ' ];
65
+ yield ['FooBar ' , 'foo bar ' ];
66
+ yield ['FooBar ' , 'foo-bar ' ];
67
+ yield ['FooBar ' , 'foo_bar ' ];
74
68
}
75
69
76
70
/**
77
71
* Method to seed data to testToDashSeparated.
78
72
*
79
- * @return array
73
+ * @return \Generator
80
74
*
81
75
* @since 1.0
82
76
*/
83
- public function seedTestToDashSeparated ()
77
+ public function seedTestToDashSeparated (): \ Generator
84
78
{
85
- return array (
86
- array ('Foo-Bar ' , 'Foo Bar ' ),
87
- array ('Foo-Bar ' , 'Foo-Bar ' ),
88
- array ('Foo-Bar ' , 'Foo_Bar ' ),
89
- array ('foo-bar ' , 'foo bar ' ),
90
- array ('foo-bar ' , 'foo-bar ' ),
91
- array ('foo-bar ' , 'foo_bar ' ),
92
- array ('foo-bar ' , 'foo bar ' ),
93
- array ('foo-bar ' , 'foo---bar ' ),
94
- array ('foo-bar ' , 'foo___bar ' ),
95
- );
79
+ yield ['Foo-Bar ' , 'Foo Bar ' ];
80
+ yield ['Foo-Bar ' , 'Foo-Bar ' ];
81
+ yield ['Foo-Bar ' , 'Foo_Bar ' ];
82
+ yield ['foo-bar ' , 'foo bar ' ];
83
+ yield ['foo-bar ' , 'foo-bar ' ];
84
+ yield ['foo-bar ' , 'foo_bar ' ];
85
+ yield ['foo-bar ' , 'foo bar ' ];
86
+ yield ['foo-bar ' , 'foo---bar ' ];
87
+ yield ['foo-bar ' , 'foo___bar ' ];
96
88
}
97
89
98
90
/**
99
91
* Method to seed data to testToSpaceSeparated.
100
92
*
101
- * @return array
93
+ * @return \Generator
102
94
*
103
95
* @since 1.0
104
96
*/
105
- public function seedTestToSpaceSeparated ()
97
+ public function seedTestToSpaceSeparated (): \ Generator
106
98
{
107
- return array (
108
- array ('Foo Bar ' , 'Foo Bar ' ),
109
- array ('Foo Bar ' , 'Foo-Bar ' ),
110
- array ('Foo Bar ' , 'Foo_Bar ' ),
111
- array ('foo bar ' , 'foo bar ' ),
112
- array ('foo bar ' , 'foo-bar ' ),
113
- array ('foo bar ' , 'foo_bar ' ),
114
- array ('foo bar ' , 'foo bar ' ),
115
- array ('foo bar ' , 'foo---bar ' ),
116
- array ('foo bar ' , 'foo___bar ' ),
117
- );
99
+ yield ['Foo Bar ' , 'Foo Bar ' ];
100
+ yield ['Foo Bar ' , 'Foo-Bar ' ];
101
+ yield ['Foo Bar ' , 'Foo_Bar ' ];
102
+ yield ['foo bar ' , 'foo bar ' ];
103
+ yield ['foo bar ' , 'foo-bar ' ];
104
+ yield ['foo bar ' , 'foo_bar ' ];
105
+ yield ['foo bar ' , 'foo bar ' ];
106
+ yield ['foo bar ' , 'foo---bar ' ];
107
+ yield ['foo bar ' , 'foo___bar ' ];
118
108
}
119
109
120
110
/**
121
111
* Method to seed data to testToUnderscoreSeparated.
122
112
*
123
- * @return array
113
+ * @return \Generator
124
114
*
125
115
* @since 1.0
126
116
*/
127
- public function seedTestToUnderscoreSeparated ()
117
+ public function seedTestToUnderscoreSeparated (): \ Generator
128
118
{
129
- return array (
130
- array ('Foo_Bar ' , 'Foo Bar ' ),
131
- array ('Foo_Bar ' , 'Foo-Bar ' ),
132
- array ('Foo_Bar ' , 'Foo_Bar ' ),
133
- array ('foo_bar ' , 'foo bar ' ),
134
- array ('foo_bar ' , 'foo-bar ' ),
135
- array ('foo_bar ' , 'foo_bar ' ),
136
- array ('foo_bar ' , 'foo bar ' ),
137
- array ('foo_bar ' , 'foo---bar ' ),
138
- array ('foo_bar ' , 'foo___bar ' ),
139
- );
119
+ yield ['Foo_Bar ' , 'Foo Bar ' ];
120
+ yield ['Foo_Bar ' , 'Foo-Bar ' ];
121
+ yield ['Foo_Bar ' , 'Foo_Bar ' ];
122
+ yield ['foo_bar ' , 'foo bar ' ];
123
+ yield ['foo_bar ' , 'foo-bar ' ];
124
+ yield ['foo_bar ' , 'foo_bar ' ];
125
+ yield ['foo_bar ' , 'foo bar ' ];
126
+ yield ['foo_bar ' , 'foo---bar ' ];
127
+ yield ['foo_bar ' , 'foo___bar ' ];
140
128
}
141
129
142
130
/**
143
131
* Method to seed data to testToVariable.
144
132
*
145
- * @return array
133
+ * @return \Generator
146
134
*
147
135
* @since 1.0
148
136
*/
149
- public function seedTestToVariable ()
137
+ public function seedTestToVariable (): \ Generator
150
138
{
151
- return array (
152
- array ('myFooBar ' , 'My Foo Bar ' ),
153
- array ('myFooBar ' , 'My Foo-Bar ' ),
154
- array ('myFooBar ' , 'My Foo_Bar ' ),
155
- array ('myFooBar ' , 'my foo bar ' ),
156
- array ('myFooBar ' , 'my foo-bar ' ),
157
- array ('myFooBar ' , 'my foo_bar ' ),
158
- array ('abc3def4 ' , '1abc3def4 ' ),
159
- );
139
+ yield ['myFooBar ' , 'My Foo Bar ' ];
140
+ yield ['myFooBar ' , 'My Foo-Bar ' ];
141
+ yield ['myFooBar ' , 'My Foo_Bar ' ];
142
+ yield ['myFooBar ' , 'my foo bar ' ];
143
+ yield ['myFooBar ' , 'my foo-bar ' ];
144
+ yield ['myFooBar ' , 'my foo_bar ' ];
145
+ yield ['abc3def4 ' , '1abc3def4 ' ];
160
146
}
161
147
162
148
/**
163
149
* Method to seed data to testToKey.
164
150
*
165
- * @return array
151
+ * @return \Generator
166
152
*
167
153
* @since 1.0
168
154
*/
169
- public function seedTestToKey ()
155
+ public function seedTestToKey (): \ Generator
170
156
{
171
- return array (
172
- array ('foo_bar ' , 'Foo Bar ' ),
173
- array ('foo_bar ' , 'Foo-Bar ' ),
174
- array ('foo_bar ' , 'Foo_Bar ' ),
175
- array ('foo_bar ' , 'foo bar ' ),
176
- array ('foo_bar ' , 'foo-bar ' ),
177
- array ('foo_bar ' , 'foo_bar ' ),
178
- );
157
+ yield ['foo_bar ' , 'Foo Bar ' ];
158
+ yield ['foo_bar ' , 'Foo-Bar ' ];
159
+ yield ['foo_bar ' , 'Foo_Bar ' ];
160
+ yield ['foo_bar ' , 'foo bar ' ];
161
+ yield ['foo_bar ' , 'foo-bar ' ];
162
+ yield ['foo_bar ' , 'foo_bar ' ];
179
163
}
180
164
181
165
/**
0 commit comments