Skip to content

Commit b7189e6

Browse files
committed
task: fix code style and remove verbose logging
1 parent 4a2578c commit b7189e6

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

app/Core/Support/Attributes/AITool.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AITool
1212
*
1313
* @param string $name The name of the tool as it will be exposed to the AI
1414
* @param string $description A description of what the tool does
15-
* @param string $htmxEvent An htmx event string this tool should execute after execution
15+
* @param string $htmxEvent An htmx event string this tool should execute after execution
1616
*/
1717
public function __construct(
1818
public string $name,

app/Domain/Tickets/Htmx/HtmxTicketEvents.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
namespace Leantime\Domain\Tickets\Htmx;
4+
45
enum HtmxTicketEvents: string
56
{
67
/**

app/Domain/Tickets/Services/Tickets.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public function __construct(
7777
*
7878
* @api
7979
*/
80-
8180
#[AITool(
8281
name: 'getStatusLabels',
8382
description: 'Get the status labels available for a project. This can help get the statuses in a human readable
@@ -536,10 +535,10 @@ public function getAllOpenUserTickets(?int $userId = null, ?int $project = null)
536535
public function getScheduledTasks(CarbonImmutable|string $dateFrom, CarbonImmutable|string $dateTo, ?int $userId)
537536
{
538537

539-
if(is_string($dateFrom) && dtHelper()->isValidDateString($dateFrom)) {
538+
if (is_string($dateFrom) && dtHelper()->isValidDateString($dateFrom)) {
540539
$dateFrom = dtHelper()->parseUserDateTime($dateFrom);
541540
}
542-
if(is_string($dateTo) && dtHelper()->isValidDateString($dateTo)) {
541+
if (is_string($dateTo) && dtHelper()->isValidDateString($dateTo)) {
543542
$dateTo = dtHelper()->parseUserDateTime($dateTo);
544543
}
545544

app/Domain/Wiki/Templates/articleDialog.tpl.php

+27-22
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,34 @@
2323
// $id: current page Id.
2424
// $parentId: the id of parent article.
2525
// $wikiHeadline: the output, ordered array. will be modified inside the method.
26-
// $wikiHL: the array returned from Service.getAllWikiHeadlines.
26+
// $wikiHL: the array returned from Service.getAllWikiHeadlines.
2727
// Even if it is passed by reference for performance the method will not modify it.
2828
// $indent is the string to put before the title, any level will add a space.
29-
function createTree($id, $parentId, &$wikiHeadlines, &$wikiHL, $indent) {
30-
// Finds the first article
31-
$articles = array_filter($wikiHL, function($v) use($parentId) { return $v->parent == $parentId; });
32-
if (count($articles) > 0) {
33-
usort ($articles, function($a1, $a2) { return $a1->title > $a2->title; });
34-
if ($parentId != null) {
35-
$indent = $indent . "-";
36-
}
37-
foreach ($articles as $article) {
38-
// This check prevents circular references by hiding the current page and its childs from list.
39-
if ($article->id != $id) {
40-
$art = $article;
41-
$art->title = $indent . $article->title;
42-
$wikiHeadlines[] = $art;
43-
createTree($id, $article->id, $wikiHeadlines, $wikiHL, $indent);
44-
}
45-
}
46-
}
47-
//var_dump($articles);
48-
29+
function createTree($id, $parentId, &$wikiHeadlines, &$wikiHL, $indent)
30+
{
31+
// Finds the first article
32+
$articles = array_filter($wikiHL, function ($v) use ($parentId) {
33+
return $v->parent == $parentId;
34+
});
35+
if (count($articles) > 0) {
36+
usort($articles, function ($a1, $a2) {
37+
return $a1->title > $a2->title;
38+
});
39+
if ($parentId != null) {
40+
$indent = $indent.'-';
41+
}
42+
foreach ($articles as $article) {
43+
// This check prevents circular references by hiding the current page and its childs from list.
44+
if ($article->id != $id) {
45+
$art = $article;
46+
$art->title = $indent.$article->title;
47+
$wikiHeadlines[] = $art;
48+
createTree($id, $article->id, $wikiHeadlines, $wikiHL, $indent);
49+
}
50+
}
51+
}
52+
// var_dump($articles);
53+
4954
}
5055

5156
// --------------------------
@@ -61,7 +66,7 @@ function createTree($id, $parentId, &$wikiHeadlines, &$wikiHL, $indent) {
6166
}
6267

6368
// Populates the options tree
64-
createTree($id, null, $wikiHeadlines, $wikiHL, "");
69+
createTree($id, null, $wikiHeadlines, $wikiHL, '');
6570

6671
?>
6772

makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test-code-style:
145145
./vendor/bin/pint --test --config .pint/pint.json
146146

147147
fix-code-style:
148-
./vendor/bin/pint --config .pint/pint.json --verbose
148+
./vendor/bin/pint --config .pint/pint.json
149149

150150
clear-cache:
151151
rm -rf ./bootstrap/cache/*.php

0 commit comments

Comments
 (0)