for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SebastianFeldmann\Ftp;
/**
* Mock internal ftp_connect.
*
* @param string $host
* @param string $port
* @return array
*/
function ftp_connect($host, $port)
{
return ['host' => $host, 'port' => $port];
}
* Mock internal ftp_login.
* @param array $connection
* @param string $user
* @param string $password
* @return bool
* @throws \Exception
function ftp_login($connection, $user, $password)
$password
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
function ftp_login($connection, $user, /** @scrutinizer ignore-unused */ $password)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$user
function ftp_login($connection, /** @scrutinizer ignore-unused */ $user, $password)
if ($connection['host'] != 'example.com') {
throw new \Exception('invalid connection');
if ($connection['port'] != 21) {
return true;
* Mock internal call_user_func_array.
* @param string $name
* @param array $args
function call_user_func_array($name, $args)
$args
function call_user_func_array($name, /** @scrutinizer ignore-unused */ $args)
static $iterations;
$iteration = $iterations[$name] ?? 0;
$iterations[$name]++;
$return = [
'ftp_nlist' => [
['foo.txt', 'bar.txt', 'fiz', 'baz'],
],
'ftp_pwd' => [
'/root',
'ftp_chdir' => [
false,
true,
'ftp_mdtm' => [
'20180101123055',
'20180101123056',
'20180101123057',
'20180101123058'
'ftp_size' => [
100,
200,
1,
'ftp_put' => [
];
return $return[$name][$iteration] ?? true;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.