for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @property integer $lootDollar
*/
class ClubCompetitor extends Competitor
{
protected $lootDollar = 0;
public function getLootDollar()
return $this->lootDollar;
}
protected function updateAttributes($player)
parent::updateAttributes($player);
//put back loot (for view)
$this->awardDollar = $this->lootDollar;
protected function winPrize()
parent::winPrize();
if (!$this->opponent['energy']) {
$this->awardDollar = 0;
//add to loot, instead of player
$this->lootDollar = $this->awardDollar;
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.
protected function losePrize()
parent::losePrize();
if (!$this->isCaller) {
if (!$this->energy) {
$this->reqDollar = 0;
This check marks files that end in a newline character, i.e. an empy line.
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.