1 | <?php declare(strict_types=1); |
||
2 | |||
3 | require 'vendor/autoload.php'; |
||
4 | |||
5 | use React\EventLoop\Factory; |
||
6 | use WyriHaximus\React\PSR3\Loggly\LogglyBulkLogger; |
||
7 | |||
8 | $loop = Factory::create(); |
||
9 | |||
10 | $logger = LogglyBulkLogger::create($loop, require 'token.php', 10); |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | $func = function () use ($argv, $logger) { |
||
13 | $logger->log($argv[1], $argv[2]); |
||
14 | }; |
||
15 | |||
16 | for ($i = 1; $i < 25; $i++) { |
||
17 | $loop->addTimer($i, $func); |
||
18 | } |
||
19 | |||
20 | $loop->run(); |
||
21 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.