Skip to content

Commit

Permalink
Merge pull request #47 from vicdelfant/feature/carbon-to-datetime
Browse files Browse the repository at this point in the history
Drop Carbon dependency, replace with `DateTimeImmutable`
  • Loading branch information
freekmurze authored Feb 3, 2024
2 parents d306069 + 987d834 commit baebf25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
],
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^6.5.8|^7.5",
"nesbot/carbon": "^2.65.0"
"guzzlehttp/guzzle": "^6.5.8|^7.5"
},
"require-dev": {
"laravel/pint": "^1.13",
Expand Down
3 changes: 1 addition & 2 deletions src/OhDear.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace OhDear\PhpSdk;

use Carbon\Carbon;
use GuzzleHttp\Client;
use OhDear\PhpSdk\Actions\ManagesApplicationHealthChecks;
use OhDear\PhpSdk\Actions\ManagesBrokenLinks;
Expand Down Expand Up @@ -80,6 +79,6 @@ protected function transformCollection(array $collection, string $class): array

public function convertDateFormat(string $date, $format = 'YmdHis'): string
{
return Carbon::parse($date)->format($format);
return (new \DateTimeImmutable($date))->format($format);
}
}

0 comments on commit baebf25

Please sign in to comment.