‪TYPO3CMS  9.5
MethodCallMatcherFixture.php
Go to the documentation of this file.
1 <?php
2 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 
22 {
23  public function ‪aMethod()
24  {
25  // Match: confirmMsg() needs at least 4 args
26  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4');
27  // Match: confirmMsg() can be called with 5 args (1 optional)
28  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4', 'arg5');
29  // Match: With argument unpacking we don't know how many args are actually given
30  ‪$args = [ 'arg1', 'arg2' ];
31  $foo->confirmMsg(...‪$args);
32  // Match: Too many args but some could be empty arrays
33  $foo->confirmMsg(...$arg1, ...$arg2, ...$arg3, ...$arg4, ...$arg5, ...$arg6);
34 
35  \confirmMsg();
36 
37  // No match: Only 3 args given
38  $foo->confirmMsg('arg1', 'arg2', 'arg3');
39  // No match: Too many arguments given
40  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4', 'arg5', 'arg6');
41  // No match: Only 3 args given and called statically
42  $foo::confirmMsg('arg1', 'arg2', 'arg3');
43  // No match: Called statically
44  $foo::confirmMsg('arg1', 'arg2', 'arg3', 'arg4');
45  // No match: Called statically
46  $foo::confirmMsg('arg1', 'arg2', 'arg3', 'arg4', 'arg5');
47  // No match: Line ignored
48  // @extensionScannerIgnoreLine
49  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4');
50  // @extensionScannerIgnoreLine
51  // No match: Line ignored and annotation belongs to code line below
52  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4');
53  // No match since @extensionScannerIgnoreLine annotation is used
54  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4');
55  // @extensionScannerIgnoreLine
56  $foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4', 'arg5');
57  // @extensionScannerIgnoreLine
58  $bar->bar($foo->confirmMsg('arg1', 'arg2', 'arg3', 'arg4', 'arg5'));
59  }
60 }
‪$args
‪$args
Definition: checkIntegrityCsvFixtures.php:230
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\MethodCallMatcherFixture\aMethod
‪aMethod()
Definition: MethodCallMatcherFixture.php:23
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures
Definition: ArrayDimensionMatcherFixture.php:3
‪TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\MethodCallMatcherFixture
Definition: MethodCallMatcherFixture.php:22