for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace FlightLog\Application\Damage\Command;
final class CreateDamageCommand
{
/**
* @var int
*/
private $flightId;
private $authorId;
* @var float
private $amount;
private $billId;
public function __construct($flightId, $authorId)
$this->flightId = $flightId;
$this->authorId = $authorId;
$this->billId = -1;
$this->amount = 1;
$amount
double
1
integer
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
}
* @return int
public function getFlightId()
return $this->flightId;
* @param int $flightId
public function setFlightId($flightId)
public function getAuthorId()
return $this->authorId;
* @param int $authorId
public function setAuthorId($authorId)
* @return float
public function getAmount()
return $this->amount;
* @param float $amount
public function setAmount($amount)
$this->amount = $amount;
public function getBillId()
return $this->billId;
* @param int $billId
public function setBillId($billId)
$this->billId = $billId;
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.