for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Resta\Authenticate;
use Resta\Authenticate\Resource\AuthLoginCredentialsManager;
use Resta\Request\Request as RequestClient;
class AuthenticateRequest extends RequestClient
{
/**
* With the auto injector,
* all the indices in the array are executed as methods
* and the global input is automatically injected.
*
* @var array $autoInject
*/
protected $autoInject = [];
* The values expected by the server.
* @var array
protected $expected = [];
* mandatory http method.
protected $http = [];
* @var null|object
protected $credentials;
* AuthenticateRequest constructor.
* @param AuthLoginCredentialsManager $credentials
public function __construct($credentials)
$this->credentials = $credentials;
//credentials loop for expected property
foreach ($this->credentials->get() as $credential){
$this->expected[] = $credential;
}
parent::__construct();
* @param $credentials
public function credentials($credentials)
$credentials
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function credentials(/** @scrutinizer ignore-unused */ $credentials)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$credentials = [];
foreach ($this->inputs as $inputKey=>$inputValue){
if(in_array($inputKey,$this->expected)){
$credentials[$inputKey] = $inputValue;
return $credentials;
* @var string
protected $password;
* @return string
protected function password()
return md5(sha1($this->password));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.