for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* WellCommerce Open-Source E-Commerce Platform
*
* This file is part of the WellCommerce package.
* (c) Adam Piotrowski <[email protected]>
* For the full copyright and license information,
* please view the LICENSE file that was distributed with this source code.
*/
namespace WellCommerce\Bundle\AppBundle\Entity;
/**
* Class Price
* @author Adam Piotrowski <[email protected]>
class Price
{
protected $netAmount = 0;
protected $grossAmount = 0;
protected $taxAmount = 0;
protected $taxRate = 0;
protected $currency = '';
public function getNetAmount(): float
return $this->netAmount;
}
public function setNetAmount(float $netAmount)
$this->netAmount = $netAmount;
$netAmount
integer
double
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;
public function getGrossAmount(): float
return $this->grossAmount;
public function setGrossAmount(float $grossAmount)
$this->grossAmount = $grossAmount;
$grossAmount
public function getTaxAmount(): float
return $this->taxAmount;
public function setTaxAmount(float $taxAmount)
$this->taxAmount = $taxAmount;
$taxAmount
public function getTaxRate(): float
return $this->taxRate;
public function setTaxRate(float $taxRate)
$this->taxRate = $taxRate;
$taxRate
public function getCurrency(): string
return $this->currency;
public function setCurrency(string $currency)
$this->currency = $currency;
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.