improved code styles #158 (#172)

* use php-cs-fixer instead of phpcodesniffer
* updated scrutinizer config
* adjusted code yules to all files
* updated CONTRIBUTING guidelines
This commit is contained in:
Kevin Papst
2018-06-22 21:09:10 +02:00
committed by GitHub
parent 773d27bb0e
commit cd7cbeae88
142 changed files with 775 additions and 467 deletions

View File

@@ -17,7 +17,6 @@ use App\Model\InvoiceModel;
*/
interface CalculatorInterface
{
/**
* Return the timesheet records that will be displayed on the invoice.
*

View File

@@ -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);
}

View File

@@ -16,7 +16,6 @@ use App\Model\InvoiceModel;
*/
interface NumberGeneratorInterface
{
/**
* @param InvoiceModel $model
*/

View File

@@ -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;
}
}

View File

@@ -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());
}