for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace PeeHaa\AsyncTwitter\Oauth;
use PeeHaa\AsyncTwitter\Oauth\Signature\Signature;
class Header
{
private $parameters;
private $signature;
public function __construct(Parameters $parameters, Signature $signature)
$this->parameters = $parameters;
$this->signature = $signature;
}
public function getHeader(): string
$header = 'OAuth ';
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$header.= 'oauth_consumer_key="' . $this->parameters->getConsumerKey() . '", ';
$header.= 'oauth_nonce="' . $this->parameters->getNonce() . '", ';
$header.= 'oauth_signature="' . $this->signature->getSignature() . '", ';
$header.= 'oauth_signature_method="' . $this->parameters->getSignatureMethod() . '", ';
$header.= 'oauth_timestamp="' . $this->parameters->getTimestamp() . '", ';
$header.= 'oauth_token="' . $this->parameters->getToken() . '", ';
$header.= 'oauth_version="' . $this->parameters->getVersion() . '"';
return $header;
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.