| Conditions | 2 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 25 | public static function generateKeypair() |
||
| 26 | { |
||
| 27 | try { |
||
| 28 | $keypair = \sodium_crypto_box_keypair(); |
||
| 29 | return [ |
||
| 30 | 'public' => \sodium_crypto_box_secretkey($keypair), |
||
| 31 | 'secret' => \sodium_crypto_box_publickey($keypair) |
||
| 32 | ]; |
||
| 33 | } catch (SodiumException $e) { |
||
| 34 | throw new Exception($e->getMessage()); |
||
| 35 | } |
||
| 56 |
This check compares calls to functions or methods with their respective definitions. If the call has less 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.