• 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/SaveCreditHours.php
1
<?php
2

3
namespace EricFortmeyer\ActivityLog\Http\RequestProcessors;
4

5
use Phpolar\Phpolar\Auth\Authorize;
6
use Phpolar\{
7
    Model\Model,
8
    Storage\NotFound
9
};
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 SaveCreditHours extends AbstractTenantBasedRequestProcessor
26
{
27
    public function __construct(
28
        private readonly string $appVersion,
29
        private readonly CreditHoursService $creditHoursService,
30
        private readonly RemarksForMonthService $remarksService,
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] CreditHours $creditHours = new CreditHours(),
41
        #[Model] MonthFilters $monthFilters = new MonthFilters()
42
    ): string {
43
        if ($creditHours->isValid() === true) {
×
44
            $this->creditHoursService->save($creditHours, $this->getTenantId());
×
45
        }
46
        $creditHours->isPosted();
×
47

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

56
        $timeEntries = $this->timeEntryService->getAllByMonth(
×
57
            month: $creditHours->month,
×
58
            year: $creditHours->year,
×
59
            tenantId: $this->getTenantId(),
×
60
        );
×
61
        $currentEntry = new TimeEntry();
×
62
        TimeEntry::setUninitializedValues(
×
63
            $currentEntry,
×
64
            $creditHours->month,
×
65
            $creditHours->year,
×
66
        );
×
67
        return $this->templateEngine->apply(
×
68
            "index",
×
69
            $remarks instanceof NotFound
×
70
                ? new TimeEntriesContext(
×
NEW
71
                    appVersion: $this->appVersion,
×
72
                    timeEntries: $timeEntries,
×
73
                    tenantId: $this->getTenantId(),
×
74
                    currentEntry: $currentEntry,
×
75
                    filters: $monthFilters,
×
76
                    creditHours: $creditHours,
×
77
                    user: $this->user
×
78
                )
×
NEW
79
                    : new TimeEntriesContext(
×
NEW
80
                        appVersion: $this->appVersion,
×
NEW
81
                        timeEntries: $timeEntries,
×
NEW
82
                        tenantId: $this->getTenantId(),
×
NEW
83
                        currentEntry: $currentEntry,
×
NEW
84
                        filters: $monthFilters,
×
NEW
85
                        remarks: $remarks,
×
NEW
86
                        creditHours: $creditHours,
×
NEW
87
                        user: $this->user,
×
NEW
88
                    )
×
UNCOV
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