for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Behat\Behat\Context\Context;
use Puzzle\Configuration\Yaml;
use Gaufrette\Filesystem;
use Gaufrette\Adapter\Local;
use RabbitMQ\Management\APIClient;
use Puzzle\AMQP\Clients\Pecl;
abstract class AbstractRabbitMQContext implements Context
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
const
TEXT_ROUTING_KEY = 'text.key',
JSON_ROUTING_KEY = 'json.key';
protected
$api,
$api
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
class A { var $property; }
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.
$exchange,
$client,
$configuration;
public function __construct($path)
$this->configuration = new Yaml(new Filesystem(new Local($path)));
$this->exchange = 'puzzle';
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.
$this->api = APIClient::factory(['host' => $this->host()]);
$this->client = new Pecl($this->configuration);
}
private function host()
return $this->configuration->readRequired('amqp/broker/host');
protected function vhost()
return $this->configuration->readRequired('amqp/broker/vhost');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.