Skip to content

Commit

Permalink
Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppekroghitk committed Jan 2, 2025
1 parent b02b144 commit 7883be8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 31 deletions.
1 change: 0 additions & 1 deletion assets/controllers/toggle-parent-child_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default class extends Controller {

displayChildrenForParentIds = [];


svgExpand = `<svg class="svg-inline--fa fa-caret-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"></path></svg>`;

svgCollapse = `<svg class="svg-inline--fa fa-caret-down" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg=""><path fill="currentColor" d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"></path></svg>`;
Expand Down
12 changes: 1 addition & 11 deletions src/Form/InvoicingRateReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$yearChoices[$year] = $year;
}

$builder
/*->add('viewMode', EnumType::class, [
'required' => false,
'label' => 'invoicing_rate_report.select_viewmode',
'label_attr' => ['class' => 'label'],
'placeholder' => false,
'attr' => [
'class' => 'form-element',
],
'class' => InvoicingRateReportViewModeEnum::class,
])*/
$builder
->add('year', ChoiceType::class, [
'label' => 'invoicing_rate_report.year',
'label_attr' => ['class' => 'label'],
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Reports/InvoicingRateReportData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class InvoicingRateReportData
public ArrayCollection $periodAverages;
public float $totalAverage;
/**
* @var false
* @var bool
*/
public bool $includeIssues;

Expand Down
1 change: 0 additions & 1 deletion src/Model/Reports/InvoicingRateReportFormData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
class InvoicingRateReportFormData
{
public WorkloadReportPeriodTypeEnum $viewPeriodType;
public InvoicingRateReportViewModeEnum $viewMode;
public int $year;
public bool $includeIssues;
}
2 changes: 1 addition & 1 deletion src/Model/Reports/InvoicingRateReportWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class InvoicingRateReportWorker extends Worker
/** @var ArrayCollection<int, array> */
public ArrayCollection $dataByPeriod;

/** @var ArrayCollection<int, array> */
/** @var ArrayCollection<string, array> */
public ArrayCollection $projectData;

public function __construct()
Expand Down
22 changes: 9 additions & 13 deletions src/Service/InvoicingRateReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@ public function __construct(
/**
* Generates an invoicing rate report for a specific year based on various parameters.
*
* @param int $year The year for which the report is generated.
* @param PeriodTypeEnum $viewPeriodType The period type.
* @param InvoicingRateReportViewModeEnum $viewMode The view mode.
* @param bool $includeIssues Whether to include detailed issue-level data in the report.
* @param int $year the year for which the report is generated
* @param PeriodTypeEnum $viewPeriodType the period type
* @param InvoicingRateReportViewModeEnum $viewMode the view mode
* @param bool $includeIssues whether to include detailed issue-level data in the report
*
* @return InvoicingRateReportData The calculated invoicing rate report data.
* @return InvoicingRateReportData the calculated invoicing rate report data
*
* @throws \Exception If a required worker identifier is empty.
* @throws \Exception if a required worker identifier is empty
*/
public function getInvoicingRateReport(
int $year,
PeriodTypeEnum $viewPeriodType = PeriodTypeEnum::WEEK,
InvoicingRateReportViewModeEnum $viewMode = InvoicingRateReportViewModeEnum::SUMMARY,
bool $includeIssues = false
): InvoicingRateReportData
{
bool $includeIssues = false,
): InvoicingRateReportData {
$invoicingRateReportData = new InvoicingRateReportData($viewPeriodType->value);
$invoicingRateReportData->includeIssues = $includeIssues;
if (!$year) {
Expand Down Expand Up @@ -142,13 +141,10 @@ public function getInvoicingRateReport(
$invoicingRateReportData->workers->add($invoicingRateReportWorker);

$invoicingRateReportWorker->projectData->set('projects', [
$workerProjects ?? []
$workerProjects,
]);

}



// Calculate and set the total average
$numberOfPeriods = count($invoicingRateReportData->periodAverages);

Expand Down
3 changes: 0 additions & 3 deletions templates/reports/invoicing_rate_report.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@
</td>
{% endfor %}



{% for issueName, issueDetails in issues %}

{% if not (issueName matches '/^\\d+$/') %}
Expand Down Expand Up @@ -153,7 +151,6 @@
{% endfor %}
{% endfor %}


</tbody>
{% endfor %}
<tbody>
Expand Down

0 comments on commit 7883be8

Please sign in to comment.