• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ericfortmeyer / activity-log / 20521974594

26 Dec 2025 11:53AM UTC coverage: 43.123% (-6.0%) from 49.13%
20521974594

push

github

web-flow
feat: add webhook for deployments (#63)

Signed-off-by: Eric Fortmeyer <e.fortmeyer01@gmail.com>

11 of 128 new or added lines in 13 files covered. (8.59%)

1 existing line in 1 file now uncovered.

348 of 807 relevant lines covered (43.12%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Http/RequestProcessors/SaveRemarksForMonth.php
1
<?php
2

3
namespace EricFortmeyer\ActivityLog\Http\RequestProcessors;
4

5
use Phpolar\{
6
    Model\Model,
7
    Storage\NotFound
8
};
9
use Phpolar\Phpolar\Auth\Authorize;
10
use EricFortmeyer\ActivityLog\{
11
    RemarksForMonth,
12
    MonthFilters,
13
    CreditHours,
14
    TimeEntry
15
};
16
use EricFortmeyer\ActivityLog\Services\{
17
    RemarksForMonthService,
18
    CreditHoursService,
19
    TemplateBinder,
20
    TimeEntryService
21
};
22
use EricFortmeyer\ActivityLog\UserInterface\Contexts\TimeEntriesContext;
23
use EricFortmeyer\ActivityLog\Utils\Hasher;
24

25
final class SaveRemarksForMonth extends AbstractTenantBasedRequestProcessor
26
{
27
    public function __construct(
28
        private readonly string $appVersion,
29
        private readonly RemarksForMonthService $remarksService,
30
        private readonly CreditHoursService $creditHoursService,
31
        private readonly TimeEntryService $timeEntryService,
32
        private readonly TemplateBinder $templateEngine,
33
        readonly Hasher $hasher,
34
    ) {
35
        parent::__construct($hasher);
×
36
    }
37

38
    #[Authorize]
39
    public function process(
40
        #[Model] RemarksForMonth $remarks = new RemarksForMonth(),
41
        #[Model] MonthFilters $monthFilters = new MonthFilters()
42
    ): string {
43
        if ($remarks->isValid() === true) {
×
44
            $this->remarksService->save($remarks, $this->getTenantId());
×
45
        }
46
        $remarks->isPosted();
×
47

48
        $creditHours = $this->creditHoursService->get(
×
49
            CreditHours::getIdFromMonth(
×
50
                year: $remarks->year,
×
51
                month: $remarks->month,
×
52
                tenantId: $this->getTenantId(),
×
53
            ),
×
54
        );
×
55

56
        $timeEntries = $this->timeEntryService->getAllByMonth(
×
57
            month: $remarks->month,
×
58
            year: $remarks->year,
×
59
            tenantId: $this->getTenantId(),
×
60
        );
×
61
        $currentEntry = new TimeEntry();
×
62
        TimeEntry::setUninitializedValues(
×
63
            $currentEntry,
×
64
            $remarks->month,
×
65
            $remarks->year,
×
66
        );
×
67
        return $this->templateEngine->apply(
×
68
            "index",
×
69
            $creditHours instanceof NotFound
×
70
                ? new TimeEntriesContext(
×
NEW
71
                    appVersion: $this->appVersion,
×
72
                    timeEntries: $timeEntries,
×
73
                    tenantId: $this->getTenantId(),
×
74
                    currentEntry: $currentEntry,
×
75
                    filters: $monthFilters,
×
76
                    remarks: $remarks,
×
77
                    user: $this->user,
×
78
                )
×
79
                : new TimeEntriesContext(
×
NEW
80
                    appVersion: $this->appVersion,
×
81
                    timeEntries: $timeEntries,
×
82
                    tenantId: $this->getTenantId(),
×
83
                    currentEntry: $currentEntry,
×
84
                    filters: $monthFilters,
×
85
                    remarks: $remarks,
×
86
                    creditHours: $creditHours,
×
87
                    user: $this->user,
×
88
                )
×
89
        );
×
90
    }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc