Skip to content

Commit

Permalink
Updated to laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Mar 27, 2024
1 parent b141e2e commit a6b1941
Show file tree
Hide file tree
Showing 23 changed files with 1,590 additions and 852 deletions.
2 changes: 1 addition & 1 deletion app/Service/DashboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function constrainDateByPossibleDates(Builder $builder, Collection $poss
{
$value1 = Carbon::createFromFormat('Y-m-d', $possibleDates->first(), $timeZone);
$value2 = Carbon::createFromFormat('Y-m-d', $possibleDates->last(), $timeZone);
if ($value2 === false || $value1 === false) {
if ($value2 === null || $value1 === null) {
throw new \RuntimeException('Provided date is not valid');
}
if ($value1->gt($value2)) {
Expand Down
4 changes: 2 additions & 2 deletions app/Service/Import/Importers/ClockifyTimeEntriesImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function importData(string $data): void
} else {
$start = Carbon::createFromFormat('m/d/Y H:i:s A', $record['Start Date'].' '.$record['Start Time'], 'UTC');
}
if ($start === false) {
if ($start === null) {
throw new ImportException('Start date ("'.$record['Start Date'].'") or time ("'.$record['Start Time'].'") are invalid');
}
$timeEntry->start = $start;
Expand All @@ -113,7 +113,7 @@ public function importData(string $data): void
} else {
$end = Carbon::createFromFormat('m/d/Y H:i:s A', $record['End Date'].' '.$record['End Time'], 'UTC');
}
if ($end === false) {
if ($end === null) {
throw new ImportException('End date ("'.$record['End Date'].'") or time ("'.$record['End Time'].'") are invalid');
}
$timeEntry->end = $end;
Expand Down
4 changes: 2 additions & 2 deletions app/Service/Import/Importers/TogglTimeEntriesImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public function importData(string $data): void
$timeEntry->billable = $record['Billable'] === 'Yes';
$timeEntry->tags = $this->getTags($record['Tags']);
$start = Carbon::createFromFormat('Y-m-d H:i:s', $record['Start date'].' '.$record['Start time'], 'UTC');
if ($start === false) {
if ($start === null) {
throw new ImportException('Start date ("'.$record['Start date'].'") or time ("'.$record['Start time'].'") are invalid');
}
$timeEntry->start = $start;
$end = Carbon::createFromFormat('Y-m-d H:i:s', $record['End date'].' '.$record['End time'], 'UTC');
if ($end === false) {
if ($end === null) {
throw new ImportException('End date ("'.$record['End date'].'") or time ("'.$record['End time'].'") are invalid');
}
$timeEntry->end = $end;
Expand Down
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "solidtime-io/solidtime",
"type": "project",
"description": "An open-source time-tracking app",
"version": "0.0.1",
"keywords": [],
"license": "AGPL-3.0-or-later",
"require": {
Expand All @@ -10,16 +11,16 @@
"dedoc/scramble": "dev-main",
"filament/filament": "^3.2",
"guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^0.6.8",
"inertiajs/inertia-laravel": "^1.0",
"korridor/laravel-model-validation-rules": "^3.0",
"laravel/framework": "^10.10",
"laravel/jetstream": "^4.2",
"laravel/passport": "^11.10.2",
"laravel/framework": "^11.0",
"laravel/jetstream": "^5.0",
"laravel/passport": "^12.0",
"laravel/tinker": "^2.8",
"pxlrbt/filament-environment-indicator": "^2.0",
"spatie/temporary-directory": "^2.2",
"tightenco/ziggy": "^1.0",
"tpetry/laravel-postgresql-enhanced": "^0.36.0"
"tightenco/ziggy": "^2.1.0",
"tpetry/laravel-postgresql-enhanced": "^0.37.0"
},
"require-dev": {
"brianium/paratest": "^7.3",
Expand All @@ -28,10 +29,10 @@
"larastan/larastan": "^2.0",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"laravel/telescope": "^4.17",
"laravel/telescope": "^5.0",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11",
"spatie/laravel-ignition": "^2.0",
"timacdonald/log-fake": "^2.1"
},
Expand Down
Loading

0 comments on commit a6b1941

Please sign in to comment.