fix phpstan/phpcs

This commit is contained in:
Dennis Eichhorn 2021-06-26 14:38:08 +02:00
parent 3db37d65cf
commit b250cf795f
3 changed files with 70 additions and 62 deletions

View File

@ -31,7 +31,15 @@ use phpOMS\Views\View;
final class BackendController extends Controller final class BackendController extends Controller
{ {
/** /**
* {@inheritdoc} * Method which shows the sales dashboard
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface Response can be rendered
*
* @since 1.0.0
*/ */
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{ {

View File

@ -25,16 +25,16 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet"> <section class="portlet">
<div class="portlet-body"> <div class="portlet-body">
<h2><?= $this->getHtml('Current'); ?></h2> <h2><?= $this->getHtml('Current'); ?></h2>
<div class="form-group"> <div class="form-group">
<div class="input-control"> <div class="input-control">
<label for="iOname"><?= $this->getHtml('Start'); ?></label> <label for="iOname"><?= $this->getHtml('Start'); ?></label>
<input type="date"> <input type="date">
</div> </div>
<div class="input-control"> <div class="input-control">
<label for="iOname"><?= $this->getHtml('End'); ?></label> <label for="iOname"><?= $this->getHtml('End'); ?></label>
<input type="date"> <input type="date">
</div> </div>
</div> </div>
@ -42,24 +42,24 @@ echo $this->getData('nav')->render();
<div class="form-group"> <div class="form-group">
<div class="input-control"> <div class="input-control">
<label for="iOname"><?= $this->getHtml('Start'); ?></label> <label for="iOname"><?= $this->getHtml('Start'); ?></label>
<input type="date"> <input type="date">
</div> </div>
<div class="input-control"> <div class="input-control">
<label for="iOname"><?= $this->getHtml('End'); ?></label> <label for="iOname"><?= $this->getHtml('End'); ?></label>
<input type="date"> <input type="date">
</div> </div>
</div> </div>
</div> </div>
<div class="portlet-foot"> <div class="portlet-foot">
<input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Analyze'); ?>"> <input id="iSubmitGeneral" name="submitGeneral" type="submit" value="<?= $this->getHtml('Analyze'); ?>">
</div> </div>
</section> </section>
</div> </div>
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet highlight-2"> <section class="portlet highlight-2">
<div class="portlet-head">Actual</div> <div class="portlet-head">Actual</div>
<div class="portlet-body"> <div class="portlet-body">
<div class="form-group"> <div class="form-group">
<div>Sales MTD:</div> <div>Sales MTD:</div>
@ -86,7 +86,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet highlight-3"> <section class="portlet highlight-3">
<div class="portlet-head">Budget</div> <div class="portlet-head">Budget</div>
<div class="portlet-body"> <div class="portlet-body">
<div class="form-group"> <div class="form-group">
<div>Sales MTD:</div> <div>Sales MTD:</div>
@ -115,13 +115,13 @@ echo $this->getData('nav')->render();
<div class="row"> <div class="row">
<div class="col-xs-12 col-lg-6"> <div class="col-xs-12 col-lg-6">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"> <div class="portlet-head">
Sales / Profit - Monthly Sales / Profit - Monthly
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?> <?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div> </div>
<?php $salesCustomer = $this->getData('monthlySalesCustomer'); ?> <?php $salesCustomer = $this->getData('monthlySalesCustomer'); ?>
<div class="portlet-body"> <div class="portlet-body">
<canvas id="sales-region" data-chart='{ <canvas id="sales-region" data-chart='{
"type": "bar", "type": "bar",
"data": { "data": {
"labels": [ "labels": [
@ -173,10 +173,10 @@ echo $this->getData('nav')->render();
] ]
}, },
"options": { "options": {
"title": { "title": {
"display": false, "display": false,
"text": "Sales / Profit" "text": "Sales / Profit"
}, },
"scales": { "scales": {
"yAxes": [ "yAxes": [
{ {
@ -201,41 +201,41 @@ echo $this->getData('nav')->render();
} }
}'></canvas> }'></canvas>
<div class="more-container"> <div class="more-container">
<input id="more-customer-sales" type="checkbox"> <input id="more-customer-sales" type="checkbox">
<label for="more-customer-sales"> <label for="more-customer-sales">
<span>Data</span> <span>Data</span>
<i class="fa fa-chevron-right expand"></i> <i class="fa fa-chevron-right expand"></i>
</label> </label>
<div> <div>
<table class="default"> <table class="default">
<thead> <thead>
<tr> <tr>
<td>Month <td>Month
<td>Sales <td>Sales
<td>Customer count <td>Customer count
<tbody> <tbody>
<?php <?php
$sum1 = 0; $sum1 = 0;
$sum2 = 0; $sum2 = 0;
foreach ($salesCustomer as $values) : foreach ($salesCustomer as $values) :
$sum1 += ((int) $values['net_sales']) / 1000; $sum1 += ((int) $values['net_sales']) / 1000;
$sum2 += ((int) $values['customers']); $sum2 += ((int) $values['customers']);
?> ?>
<tr> <tr>
<td><?= $values['month'] . '/' . \substr((string) $values['year'], -2); ?> <td><?= $values['month'] . '/' . \substr((string) $values['year'], -2); ?>
<td><?= (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?> <td><?= (new Money(((int) $values['net_sales']) / 1000))->getCurrency(); ?>
<td><?= ((int) $values['customers']); ?> <td><?= ((int) $values['customers']); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td>Total <td>Total
<td><?= (new Money($sum1))->getCurrency(); ?> <td><?= (new Money($sum1))->getCurrency(); ?>
<td><?= (int) ($sum2 / 12); ?> <td><?= (int) ($sum2 / 12); ?>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<div class="col-xs-12 col-lg-6"> <div class="col-xs-12 col-lg-6">
<section class="portlet"> <section class="portlet">
@ -355,12 +355,12 @@ echo $this->getData('nav')->render();
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"> <div class="portlet-head">
Sales / Attribute Sales / Attribute
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?> <?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div> </div>
<table class="default"> <table class="default">
<thead> <thead>
<tr> <tr>
@ -377,12 +377,12 @@ echo $this->getData('nav')->render();
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"> <div class="portlet-head">
Sales / Region Sales / Region
<?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?> <?php include __DIR__ . '/../../../../Web/Backend/Themes/popup-export-data.tpl.php'; ?>
</div> </div>
<table class="default"> <table class="default">
<thead> <thead>
<tr> <tr>

View File

@ -9,7 +9,7 @@
], ],
"require-dev": { "require-dev": {
"phpunit/phpunit": ">=9.4", "phpunit/phpunit": ">=9.4",
"friendsofphp/php-cs-fixer": ">=2.18", "friendsofphp/php-cs-fixer": ">=3.0",
"squizlabs/php_codesniffer": ">=3.5", "squizlabs/php_codesniffer": ">=3.5",
"phpmd/phpmd": ">=2.9", "phpmd/phpmd": ">=2.9",
"phpstan/phpstan": ">=0.12.58", "phpstan/phpstan": ">=0.12.58",