From db59f1f2504c0c76c34ded9e4a4000122c9b0943 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Fri, 2 Feb 2024 18:39:21 +0100 Subject: [PATCH 1/2] Drop Carbon dependency, replace with `DateTimeImmutable ` --- composer.json | 3 +-- src/OhDear.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 4d95691..1b1db45 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/OhDear.php b/src/OhDear.php index 3784e3c..fac6d12 100644 --- a/src/OhDear.php +++ b/src/OhDear.php @@ -80,6 +80,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); } } From 987d83479b5ff77e15c485b3149609361388210e Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Fri, 2 Feb 2024 18:44:20 +0100 Subject: [PATCH 2/2] Remove unused class from imports --- src/OhDear.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OhDear.php b/src/OhDear.php index fac6d12..8986c7f 100644 --- a/src/OhDear.php +++ b/src/OhDear.php @@ -2,7 +2,6 @@ namespace OhDear\PhpSdk; -use Carbon\Carbon; use GuzzleHttp\Client; use OhDear\PhpSdk\Actions\ManagesApplicationHealthChecks; use OhDear\PhpSdk\Actions\ManagesBrokenLinks;