Skip to content

Commit 46ff7e5

Browse files
committed
PEAR: Fix unintentional errors in unit test case files - redeclaring functions
Fixes _Cannot redeclare _functionName()_ (previously declared in....)_ errors.
1 parent 016d870 commit 46ff7e5

9 files changed

+130
-130
lines changed

src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function emptyFunctionDocComment()
217217
* @access public
218218
* @return bool
219219
*/
220-
function myFunction($arg1) {}
220+
function myFunctionA($arg1) {}
221221

222222

223223
/**
@@ -231,7 +231,7 @@ function myFunction($arg1) {}
231231

232232
echo $blah;
233233

234-
function myFunction($arg1) {}
234+
function myFunctionB($arg1) {}
235235

236236
/**
237237
* Test function.
@@ -241,7 +241,7 @@ function myFunction($arg1) {}
241241
* @throws MyException
242242
* @throws MyException When I feel like it
243243
*/
244-
function myFunction() {}
244+
function myFunctionC() {}
245245

246246
abstract class MyClass {
247247
/**
@@ -306,7 +306,7 @@ function completeStep($status, array $array = [Class1::class, 'test'], $note = '
306306
*
307307
* @return void
308308
*/
309-
function myFunction(string $name1, string ...$name2) {
309+
function myFunctionD(string $name1, string ...$name2) {
310310
}
311311

312312

@@ -318,7 +318,7 @@ function myFunction(string $name1, string ...$name2) {
318318
*
319319
* @return void
320320
*/
321-
function myFunction(string $name1, string ...$name2) {
321+
function myFunctionE(string $name1, string ...$name2) {
322322
}
323323

324324
/**
@@ -333,7 +333,7 @@ function myFunction(string $name1, string ...$name2) {
333333
* Return value
334334
*
335335
*/
336-
function foo($bar) {
336+
function fooBar($bar) {
337337
}
338338

339339
/**
@@ -348,7 +348,7 @@ function foo($bar) {
348348
* @return void
349349
* @see register()
350350
*/
351-
function process(File $phpcsFile, $stackPtr)
351+
function processA(File $phpcsFile, $stackPtr)
352352
{
353353

354354
}//end process()
@@ -366,7 +366,7 @@ function process(File $phpcsFile, $stackPtr)
366366
* @return void
367367
* @see register()
368368
*/
369-
function process(File $phpcsFile, $stackPtr)
369+
function processB(File $phpcsFile, $stackPtr)
370370
{
371371

372372
}//end process()

src/Standards/PEAR/Tests/Commenting/FunctionCommentUnitTest.inc.fixed

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function emptyFunctionDocComment()
217217
* @access public
218218
* @return bool
219219
*/
220-
function myFunction($arg1) {}
220+
function myFunctionA($arg1) {}
221221

222222

223223
/**
@@ -231,7 +231,7 @@ function myFunction($arg1) {}
231231

232232
echo $blah;
233233

234-
function myFunction($arg1) {}
234+
function myFunctionB($arg1) {}
235235

236236
/**
237237
* Test function.
@@ -241,7 +241,7 @@ function myFunction($arg1) {}
241241
* @throws MyException
242242
* @throws MyException When I feel like it
243243
*/
244-
function myFunction() {}
244+
function myFunctionC() {}
245245

246246
abstract class MyClass {
247247
/**
@@ -306,7 +306,7 @@ function completeStep($status, array $array = [Class1::class, 'test'], $note = '
306306
*
307307
* @return void
308308
*/
309-
function myFunction(string $name1, string ...$name2) {
309+
function myFunctionD(string $name1, string ...$name2) {
310310
}
311311

312312

@@ -318,7 +318,7 @@ function myFunction(string $name1, string ...$name2) {
318318
*
319319
* @return void
320320
*/
321-
function myFunction(string $name1, string ...$name2) {
321+
function myFunctionE(string $name1, string ...$name2) {
322322
}
323323

324324
/**
@@ -333,7 +333,7 @@ function myFunction(string $name1, string ...$name2) {
333333
* Return value
334334
*
335335
*/
336-
function foo($bar) {
336+
function fooBar($bar) {
337337
}
338338

339339
/**
@@ -348,7 +348,7 @@ function foo($bar) {
348348
* @return void
349349
* @see register()
350350
*/
351-
function process(File $phpcsFile, $stackPtr)
351+
function processA(File $phpcsFile, $stackPtr)
352352
{
353353

354354
}//end process()
@@ -366,7 +366,7 @@ function process(File $phpcsFile, $stackPtr)
366366
* @return void
367367
* @see register()
368368
*/
369-
function process(File $phpcsFile, $stackPtr)
369+
function processB(File $phpcsFile, $stackPtr)
370370
{
371371

372372
}//end process()

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ $bar = new stdClass(
142142
4, /* thanks */ 5, /* PSR-2 */ 6
143143
);
144144

145-
function doSomething()
145+
function doSomethingElse()
146146
{
147147
return $this->getFoo()
148148
->doBar(
@@ -372,7 +372,7 @@ class Foo
372372
};
373373
})('a','b')('c','d');
374374

375-
function foo()
375+
function fooBar()
376376
{
377377
Bar(
378378
function () {

src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.inc.fixed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ $bar = new stdClass(
147147
6
148148
);
149149

150-
function doSomething()
150+
function doSomethingElse()
151151
{
152152
return $this->getFoo()
153153
->doBar(
@@ -385,7 +385,7 @@ class Foo
385385
};
386386
})('a','b')('c','d');
387387

388-
function foo()
388+
function fooBar()
389389
{
390390
Bar(
391391
function () {

src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.inc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $fifthParameter=123.12, $sixthParam=true
1414
function blah() {
1515
}
1616

17-
function blah()
17+
function blahblah()
1818
{
1919
}
2020

@@ -52,12 +52,12 @@ function getInstalledStandards(
5252
{
5353
}
5454

55-
function &testFunction($arg1,
55+
function &testFunctionA($arg1,
5656
$arg2,
5757
) {
5858
}
5959

60-
function testFunction($arg1,
60+
function testFunctionB($arg1,
6161
$arg2) {
6262
}
6363

@@ -138,12 +138,12 @@ function test()
138138
}
139139

140140
function
141-
myFunction()
141+
myFunctionA()
142142
{
143143
}
144144

145145
function
146-
myFunction()
146+
myFunctionB()
147147
{
148148
}
149149

@@ -161,15 +161,15 @@ namespace {
161161
$var = function() {return true;};
162162
$var = function() {return true;
163163
};
164-
function blah(){return true;
164+
function blahblahblah(){return true;
165165
}
166166

167167
$closureWithArgsAndVars = function($arg1, $arg2) use ($var1, $var2){
168168
// body
169169
};
170170

171171
function
172-
blah
172+
blahblahblahblah
173173
()
174174
{
175175
// body
@@ -179,29 +179,29 @@ $b = function &() {
179179
echo "hello";
180180
};
181181

182-
function foo(
182+
function fooA(
183183
$param1,
184184
$param2,
185185
$param3
186186
) : SomeClass {
187187
}
188188

189-
function foo(
189+
function fooB(
190190
$param1,
191191
$param2,
192192
$param3
193193
): SomeClass {
194194
}
195195

196-
function foo(
196+
function fooC(
197197
$param1,
198198
$param2,
199199
$param3
200200
): SomeClass // Comment here
201201
{
202202
}
203203

204-
function foo(
204+
function fooD(
205205
$param1,
206206

207207
$param2,
@@ -210,28 +210,28 @@ function foo(
210210
) : SomeClass {
211211
}
212212

213-
function foo(
213+
function fooE(
214214
$var
215215
)
216216
{
217217
// body
218218
}
219219

220-
function foo(
220+
function fooF(
221221
$var
222222
)
223223
/* hello */ {
224224
// body
225225
}
226226

227-
function foo(
227+
function fooG(
228228
$var
229229
)
230230
{ echo 'hi';
231231
// body
232232
}
233233

234-
function foo(
234+
function fooH(
235235
$var
236236
)
237237
/* hello */ { echo 'hi';

0 commit comments

Comments
 (0)