From bbe3444d75f381718321ba565a775e68db9c7fc2 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Fri, 5 Apr 2024 15:06:31 +0100 Subject: [PATCH] Remove helper functions (#263) --- src/Assets/AssetRepository.php | 8 ++++---- src/Commands/ImportBlueprints.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Assets/AssetRepository.php b/src/Assets/AssetRepository.php index deba6f22..9b2da69f 100644 --- a/src/Assets/AssetRepository.php +++ b/src/Assets/AssetRepository.php @@ -45,17 +45,17 @@ public function findByUrl(string $url) $siteUrl = rtrim(Site::current()->absoluteUrl(), '/'); $containerUrl = $container->url(); - if (starts_with($containerUrl, '/')) { + if (Str::startsWith($containerUrl, '/')) { $containerUrl = $siteUrl.$containerUrl; } - if (starts_with($containerUrl, $siteUrl)) { + if (Str::startsWith($containerUrl, $siteUrl)) { $url = $siteUrl.$url; } - $path = str_after($url, $containerUrl); + $path = Str::after($url, $containerUrl); - if (starts_with($path, '/')) { + if (Str::startsWith($path, '/')) { $path = substr($path, 1); } diff --git a/src/Commands/ImportBlueprints.php b/src/Commands/ImportBlueprints.php index 56102a15..d5776d2c 100644 --- a/src/Commands/ImportBlueprints.php +++ b/src/Commands/ImportBlueprints.php @@ -130,8 +130,8 @@ private function importFieldsets() ->getFilesByTypeRecursively($directory, 'yaml'); $this->withProgressBar($files, function ($path) use ($directory) { - $basename = str_after($path, str_finish($directory, '/')); - $handle = str_before($basename, '.yaml'); + $basename = Str::after($path, Str::finish($directory, '/')); + $handle = Str::before($basename, '.yaml'); $handle = str_replace('/', '.', $handle); $fieldset = Fieldset::make($handle)