diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-07-28 11:19:53 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2018-07-28 11:19:53 +0200 |
commit | 7982c3ff183aa985177bdaeacda4feb22a739e00 (patch) | |
tree | 728e07251072f3a1df63c017c0dce54fa1acb390 /application/api/ApiUtils.php | |
parent | 2075321f6569dfa610905991b315aae1956b7f78 (diff) | |
parent | ed7e1be12d65bdb1b924c7efb6a84fd591192c6c (diff) | |
download | Shaarli-7982c3ff183aa985177bdaeacda4feb22a739e00.tar.gz Shaarli-7982c3ff183aa985177bdaeacda4feb22a739e00.tar.zst Shaarli-7982c3ff183aa985177bdaeacda4feb22a739e00.zip |
Merge tag 'v0.10.0' into latest
Release v0.10.0
Diffstat (limited to 'application/api/ApiUtils.php')
-rw-r--r-- | application/api/ApiUtils.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/application/api/ApiUtils.php b/application/api/ApiUtils.php index f154bb52..fc5ecaf1 100644 --- a/application/api/ApiUtils.php +++ b/application/api/ApiUtils.php | |||
@@ -134,4 +134,20 @@ class ApiUtils | |||
134 | 134 | ||
135 | return $oldLink; | 135 | return $oldLink; |
136 | } | 136 | } |
137 | |||
138 | /** | ||
139 | * Format a Tag for the REST API. | ||
140 | * | ||
141 | * @param string $tag Tag name | ||
142 | * @param int $occurrences Number of links using this tag | ||
143 | * | ||
144 | * @return array Link data formatted for the REST API. | ||
145 | */ | ||
146 | public static function formatTag($tag, $occurences) | ||
147 | { | ||
148 | return [ | ||
149 | 'name' => $tag, | ||
150 | 'occurrences' => $occurences, | ||
151 | ]; | ||
152 | } | ||
137 | } | 153 | } |