Skip to content

Commit

Permalink
minor fixwesa
Browse files Browse the repository at this point in the history
  • Loading branch information
supun-io committed Oct 22, 2024
1 parent aca8752 commit b445bec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/Link/Metadata/MetadataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
namespace Hyvor\Unfold\Link\Metadata;


use Hyvor\Unfold\Unfolded\UnfoldedAuthor;
use Hyvor\Unfold\Unfolded\UnfoldedTag;

/**
* @template T extends string|DateTimeInterface|UnfoldedAuthor|UnfoldedTag
* @template T of string|\DateTimeInterface|UnfoldedAuthor|UnfoldedTag = string
*/
class MetadataObject
{
Expand Down
6 changes: 3 additions & 3 deletions src/Link/Metadata/MetadataPriority.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ private function prioritizedAll(array $keys)
* 'OG_TITLE' => [MetadataObject],
* ]
*/
$keysNames = array_map(fn($key) => $key->name, $keys);
$keysNames = array_map(fn ($key) => $key->name, $keys);
uksort($keyedMetadata, function ($a, $b) use ($keysNames) {
return array_search($a, $keysNames) - array_search($b, $keysNames);
});

// index by 0,1,2
$keyedMetadata = array_values($keyedMetadata);
// return the values
return array_map(fn($metadata) => $metadata->value, $keyedMetadata[0] ?? []);
return array_map(fn ($metadata) => $metadata->value, $keyedMetadata[0] ?? []);
}

/**
Expand Down Expand Up @@ -144,7 +144,7 @@ public function siteUrl(string $url): ?string
return $host ? $scheme . '://' . $host : null;
}

return null; // @ignoreCodeCoverage
return null; // @codeCoverageIgnore
}


Expand Down
1 change: 1 addition & 0 deletions src/Unfold.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static function unfold(
} else {
// both
// TODO:
throw new \Exception('Not implemented yet');
}
}
}

0 comments on commit b445bec

Please sign in to comment.