Skip to content

Commit

Permalink
Move down method to group tag related code together
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 3, 2022
1 parent 99e8a40 commit f37d9b9
Showing 1 changed file with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@
*/
class PublicationService
{
/**
* Get all available tags.
*
* @return \Rgasch\Collection\Collection
*
* @throws \Safe\Exceptions\FilesystemException
* @throws \Safe\Exceptions\JsonException
*/
public static function getAllTags(): Collection
{
$filename = Hyde::pathToRelative('tags.json');
if (! file_exists($filename)) {
return Collection::create();
}

return Collection::create(json_decode(file_get_contents($filename), true))->sortKeys();
}

/**
* Return a collection of all defined publication types, indexed by the directory name.
*
Expand Down Expand Up @@ -75,6 +57,23 @@ public static function getMediaForPubType(PublicationType $pubType): Collection
return Hyde::pathToRelative($file);
});
}
/**
* Get all available tags.
*
* @return \Rgasch\Collection\Collection
*
* @throws \Safe\Exceptions\FilesystemException
* @throws \Safe\Exceptions\JsonException
*/
public static function getAllTags(): Collection
{
$filename = Hyde::pathToRelative('tags.json');
if (! file_exists($filename)) {
return Collection::create();
}

return Collection::create(json_decode(file_get_contents($filename), true))->sortKeys();
}

/**
* Get all values for a given tag name.
Expand Down

0 comments on commit f37d9b9

Please sign in to comment.