‪TYPO3CMS  10.4
MethodArgumentUnusedMatcherFixture.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 {
25  public function ‪aMethod()
26  {
27  // Match: RTE_transform() should have arg2 as null if given
28  $foo->RTE_transform('arg1', 'arg2');
29  $foo->RTE_transform('arg1', 'arg2', 'arg3');
30 
31  // No match: null is ok
32  $foo->RTE_transform('arg1', null);
33  $foo->RTE_transform('arg1', null, 'arg3');
34  // No match: Static call
35  $foo::RTE_transform('arg1', 'arg2', 'arg3');
36  // No match: With argument unpacking we don't know how many args are actually given
37  ‪$args = [ 'arg1', 'arg2', 'arg3' ];
38  $foo->RTE_transform(...‪$args);
39  // No match: Too many args, but with argument unpacking we don't know about empty arrays
40  $args1 = [ 'arg1', 'arg2', 'arg3' ];
41  $args2 = [ 'arg4', 'arg5', 'arg6' ];
42  $args3 = [ 'arg7', 'arg8', 'arg9' ];
43  $foo->RTE_transform(...$args1, ...$args2, ...$args3);
44  // @extensionScannerIgnoreLine
45  $foo->RTE_transform('arg1', 'arg2');
46  }
47 }
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\MethodArgumentUnusedMatcherFixture
Definition: MethodArgumentUnusedMatcherFixture.php:24
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures
Definition: ArrayDimensionMatcherFixture.php:18
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\MethodArgumentUnusedMatcherFixture\aMethod
‪aMethod()
Definition: MethodArgumentUnusedMatcherFixture.php:25
‪$args
‪$args
Definition: validateRstFiles.php:214