* use php-cs-fixer instead of phpcodesniffer * updated scrutinizer config * adjusted code yules to all files * updated CONTRIBUTING guidelines
This commit is contained in:
@@ -17,7 +17,6 @@ use App\Model\InvoiceModel;
|
||||
*/
|
||||
interface CalculatorInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Return the timesheet records that will be displayed on the invoice.
|
||||
*
|
||||
|
||||
@@ -20,7 +20,6 @@ use App\Model\InvoiceModel;
|
||||
*/
|
||||
class DefaultCalculator implements CalculatorInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -56,6 +55,7 @@ class DefaultCalculator implements CalculatorInterface
|
||||
foreach ($this->model->getEntries() as $entry) {
|
||||
$amount += $entry->getRate();
|
||||
}
|
||||
|
||||
return round($amount, 2);
|
||||
}
|
||||
|
||||
@@ -73,11 +73,12 @@ class DefaultCalculator implements CalculatorInterface
|
||||
public function getTax(): float
|
||||
{
|
||||
$vat = $this->getVat();
|
||||
if ($vat == 0) {
|
||||
if (0 == $vat) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$percent = $vat / 100.00;
|
||||
|
||||
return round($this->getSubtotal() * $percent, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ use App\Model\InvoiceModel;
|
||||
*/
|
||||
interface NumberGeneratorInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param InvoiceModel $model
|
||||
*/
|
||||
|
||||
@@ -50,6 +50,7 @@ class ServiceInvoice
|
||||
return new $class();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -72,6 +73,7 @@ class ServiceInvoice
|
||||
return new $class();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -97,6 +99,7 @@ class ServiceInvoice
|
||||
return $action;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ use App\Entity\Timesheet;
|
||||
*/
|
||||
class ShortInvoiceCalculator extends DefaultCalculator
|
||||
{
|
||||
|
||||
/**
|
||||
* @return Timesheet[]
|
||||
*/
|
||||
@@ -28,7 +27,7 @@ class ShortInvoiceCalculator extends DefaultCalculator
|
||||
foreach ($this->model->getEntries() as $entry) {
|
||||
$timesheet->setRate($timesheet->getRate() + $entry->getRate());
|
||||
$timesheet->setDuration($timesheet->getDuration() + $entry->getDuration());
|
||||
if ($timesheet->getActivity() === null) {
|
||||
if (null === $timesheet->getActivity()) {
|
||||
$timesheet->setActivity($entry->getActivity());
|
||||
$timesheet->setEnd($entry->getEnd());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user