diff --git a/src/Adapters/Archive/Detectors/PublishedTime.php b/src/Adapters/Archive/Detectors/PublishedTime.php index a5c8bdac..47e36d2d 100644 --- a/src/Adapters/Archive/Detectors/PublishedTime.php +++ b/src/Adapters/Archive/Detectors/PublishedTime.php @@ -3,12 +3,12 @@ namespace Embed\Adapters\Archive\Detectors; -use Datetime; +use DateTime; use Embed\Detectors\PublishedTime as Detector; class PublishedTime extends Detector { - public function detect(): ?Datetime + public function detect(): ?DateTime { $api = $this->extractor->getApi(); diff --git a/src/Adapters/Gist/Detectors/PublishedTime.php b/src/Adapters/Gist/Detectors/PublishedTime.php index f0725d66..1487524b 100644 --- a/src/Adapters/Gist/Detectors/PublishedTime.php +++ b/src/Adapters/Gist/Detectors/PublishedTime.php @@ -3,12 +3,12 @@ namespace Embed\Adapters\Gist\Detectors; -use Datetime; +use DateTime; use Embed\Detectors\PublishedTime as Detector; class PublishedTime extends Detector { - public function detect(): ?Datetime + public function detect(): ?DateTime { $api = $this->extractor->getApi(); diff --git a/src/Adapters/ImageShack/Detectors/PublishedTime.php b/src/Adapters/ImageShack/Detectors/PublishedTime.php index d0ba809b..969804e9 100644 --- a/src/Adapters/ImageShack/Detectors/PublishedTime.php +++ b/src/Adapters/ImageShack/Detectors/PublishedTime.php @@ -3,12 +3,12 @@ namespace Embed\Adapters\ImageShack\Detectors; -use Datetime; +use DateTime; use Embed\Detectors\PublishedTime as Detector; class PublishedTime extends Detector { - public function detect(): ?Datetime + public function detect(): ?DateTime { $api = $this->extractor->getApi(); diff --git a/src/Adapters/Twitter/Detectors/PublishedTime.php b/src/Adapters/Twitter/Detectors/PublishedTime.php index ae595e87..73672988 100644 --- a/src/Adapters/Twitter/Detectors/PublishedTime.php +++ b/src/Adapters/Twitter/Detectors/PublishedTime.php @@ -3,12 +3,12 @@ namespace Embed\Adapters\Twitter\Detectors; -use Datetime; +use DateTime; use Embed\Detectors\PublishedTime as Detector; class PublishedTime extends Detector { - public function detect(): ?Datetime + public function detect(): ?DateTime { $api = $this->extractor->getApi(); diff --git a/src/ApiTrait.php b/src/ApiTrait.php index 0f976c63..f6614625 100644 --- a/src/ApiTrait.php +++ b/src/ApiTrait.php @@ -3,7 +3,7 @@ namespace Embed; -use Datetime; +use DateTime; use Psr\Http\Message\UriInterface; use Throwable; @@ -91,7 +91,7 @@ public function url(string ...$keys): ?UriInterface } } - public function time(string ...$keys): ?Datetime + public function time(string ...$keys): ?DateTime { $time = $this->str(...$keys); $datetime = $time ? date_create($time) : null; diff --git a/src/Detectors/PublishedTime.php b/src/Detectors/PublishedTime.php index 2ec7507c..f168120f 100644 --- a/src/Detectors/PublishedTime.php +++ b/src/Detectors/PublishedTime.php @@ -3,11 +3,11 @@ namespace Embed\Detectors; -use Datetime; +use DateTime; class PublishedTime extends Detector { - public function detect(): ?Datetime + public function detect(): ?DateTime { $oembed = $this->extractor->getOEmbed(); $metas = $this->extractor->getMetas(); @@ -47,7 +47,7 @@ public function detect(): ?Datetime * Some sites using WordPress have the published time in the url * For example: mysite.com/2020/05/19/post-title */ - private function detectFromPath(): ?Datetime + private function detectFromPath(): ?DateTime { $path = $this->extractor->getUri()->getPath(); diff --git a/tests/PagesTestCase.php b/tests/PagesTestCase.php index b3b99fa6..56d90a01 100644 --- a/tests/PagesTestCase.php +++ b/tests/PagesTestCase.php @@ -4,7 +4,7 @@ namespace Embed\Tests; use Brick\VarExporter\VarExporter; -use Datetime; +use DateTime; use Embed\Embed; use Embed\Extractor; use Embed\ExtractorFactory; @@ -125,7 +125,7 @@ private static function convert($value) return (string) $value; } - if ($value instanceof Datetime) { + if ($value instanceof DateTime) { return $value->format('Y-m-d H:i:s'); }