Skip to content

Commit 7e63269

Browse files
committed
refactor: remove unused exception variable
fix(hooks): use docker compose commands in pre-commit Hooks must run via Docker as tools are not installed locally.
1 parent b962a24 commit 7e63269

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

captainhook.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
]
2323
},
2424
{
25-
"action": "php -d memory_limit=1G bin/phpstan analyze --no-progress",
25+
"action": "COMPOSE_PROFILES=tools docker compose run --rm app-tools php -d memory_limit=1G bin/phpstan analyze --no-progress",
2626
"options": {
2727
"label": "PHPStan: Static analysis"
2828
},
@@ -34,7 +34,7 @@
3434
]
3535
},
3636
{
37-
"action": "php -d memory_limit=512M bin/php-cs-fixer fix --dry-run --diff",
37+
"action": "COMPOSE_PROFILES=tools docker compose run --rm app-tools composer cs-check",
3838
"options": {
3939
"label": "PHP-CS-Fixer: Code style"
4040
},
@@ -46,7 +46,7 @@
4646
]
4747
},
4848
{
49-
"action": "php -d memory_limit=512M bin/phpat",
49+
"action": "COMPOSE_PROFILES=tools docker compose run --rm app-tools composer analyze:arch",
5050
"options": {
5151
"label": "PHPat: Architecture rules"
5252
},
@@ -58,7 +58,7 @@
5858
]
5959
},
6060
{
61-
"action": "php bin/console lint:twig templates/",
61+
"action": "COMPOSE_PROFILES=tools docker compose run --rm app-tools composer twig:lint",
6262
"options": {
6363
"label": "Twig: Template syntax"
6464
},

src/Controller/Tracking/SaveEntryAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function __invoke(
135135
$dayDate = new DateTime($entrySaveDto->date);
136136
$entry->setDay($dayDate);
137137
}
138-
} catch (Exception $exception) {
138+
} catch (Exception) {
139139
return new Error('Given day does not have a valid format.', Response::HTTP_BAD_REQUEST);
140140
}
141141

0 commit comments

Comments
 (0)