Skip to content

Commit 58ac9d3

Browse files
committed
Import classes
1 parent 0d5818c commit 58ac9d3

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/Chrono.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace DirectoryTree\Chrono;
44

5+
use BadMethodCallException;
56
use Carbon\CarbonImmutable;
67
use Carbon\CarbonInterface;
78
use DirectoryTree\Chrono\Locales\De\DeChrono;
@@ -586,7 +587,7 @@ protected function dates(
586587
public function __call(string $method, array $parameters): mixed
587588
{
588589
if (! in_array($method, ['parse', 'date', 'dates'], true)) {
589-
throw new \BadMethodCallException(sprintf(
590+
throw new BadMethodCallException(sprintf(
590591
'Method [%s] does not exist on [%s].',
591592
$method,
592593
static::class,
@@ -604,7 +605,7 @@ public function __call(string $method, array $parameters): mixed
604605
public static function __callStatic(string $method, array $parameters): mixed
605606
{
606607
if (! in_array($method, ['parse', 'date', 'dates'], true)) {
607-
throw new \BadMethodCallException(sprintf(
608+
throw new BadMethodCallException(sprintf(
608609
'Method [%s] does not exist on [%s].',
609610
$method,
610611
static::class,

src/Parsers/NativeDateFormatParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace DirectoryTree\Chrono\Parsers;
44

55
use Carbon\CarbonImmutable;
6+
use DateTimeImmutable;
67
use DirectoryTree\Chrono\Locales\En\CreatesParsedComponents;
78
use DirectoryTree\Chrono\Options;
89
use DirectoryTree\Chrono\ParsedResult;
@@ -81,7 +82,7 @@ protected function date(string $text): ?CarbonImmutable
8182
$normalized = preg_replace('/\s*\([^)]*\)\s*$/', '', trim($text)) ?? trim($text);
8283

8384
if (preg_match('/^\d{1,2}\/\d{1,2}\/\d{4}\s+/', $normalized) === 1) {
84-
$date = \DateTimeImmutable::createFromFormat('!m/d/Y h:i:s.u A', $this->normalizeFractionalSeconds($normalized));
85+
$date = DateTimeImmutable::createFromFormat('!m/d/Y h:i:s.u A', $this->normalizeFractionalSeconds($normalized));
8586

8687
return $date === false ? null : CarbonImmutable::instance($date);
8788
}

src/Reference.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Carbon\CarbonImmutable;
66
use Carbon\CarbonInterface;
7+
use DateTimeImmutable;
78

89
readonly class Reference
910
{
@@ -100,7 +101,7 @@ protected static function javascriptDateString(string $reference): ?CarbonImmuta
100101
return null;
101102
}
102103

103-
$date = \DateTimeImmutable::createFromFormat(
104+
$date = DateTimeImmutable::createFromFormat(
104105
'M j Y H:i:s \G\M\TO',
105106
preg_replace('/^[A-Z][a-z]{2}\s+/', '', $reference) ?? $reference,
106107
);

0 commit comments

Comments
 (0)