for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace SlevomatCsobGateway\Api\Driver;
use RuntimeException;
use SlevomatCsobGateway\Api\ApiClientDriverException;
class CurlDriverException extends RuntimeException implements ApiClientDriverException
{
/** @var mixed */
private $info;
/**
* @param resource $handle
*/
public function __construct($handle)
parent::__construct('Request error: ' . curl_error($handle));
$this->code = curl_errno($handle);
$this->info = curl_getinfo($handle);
$this->info
curl_getinfo($handle)
null
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
class A { function getObject() { return null; } } $a = new A(); $object = $a->getObject();
The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
}
* @see curl_getinfo()
*
* @return mixed
public function getInfo()
return $this->info;
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.