Skip to content

Commit

Permalink
Remove helper functions (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Apr 5, 2024
1 parent 9f688d6 commit bbe3444
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Assets/AssetRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/ImportBlueprints.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbe3444

Please sign in to comment.