Skip to content

Commit cec40cf

Browse files
tanhongitgithub-actions[bot]
authored andcommitted
Fix styling
1 parent df1f66a commit cec40cf

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/OpenApi/Schemas/Resources/Post/PostNavigateResourceSchema.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
description: "Previous post for navigation",
1515
oneOf: [
1616
new Schema(ref: PostNavigationResourceSchema::class),
17-
new Schema(type: "null")
17+
new Schema(type: "null"),
1818
]
1919
),
2020
new Property(
21-
property: "next",
21+
property: "next",
2222
description: "Next post for navigation",
2323
oneOf: [
2424
new Schema(ref: PostNavigationResourceSchema::class),
25-
new Schema(type: "null")
25+
new Schema(type: "null"),
2626
]
2727
),
2828
],

src/Services/PostService.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
namespace CSlant\Blog\Api\Services;
44

55
use CSlant\Blog\Api\Supports\Queries\QueryPost;
6-
use CSlant\Blog\Core\Enums\StatusEnum;
7-
use CSlant\Blog\Core\Facades\Base\SlugHelper;
86
use CSlant\Blog\Core\Http\Responses\Base\BaseHttpResponse;
97
use CSlant\Blog\Core\Models\Post;
10-
use CSlant\Blog\Core\Models\Slug;
118
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
129
use Illuminate\Support\Arr;
1310

@@ -63,7 +60,7 @@ public function getNavigationPosts(Post $currentPost): array
6360

6461
// Get previous post
6562
$previous = $this->getSingleNavigationPost($currentPost->id, $categoryIds, $tagIds);
66-
63+
6764
// Get next post (exclude the previous post if found)
6865
$excludeIds = [$currentPost->id];
6966
if ($previous) {
@@ -84,7 +81,7 @@ public function getNavigationPosts(Post $currentPost): array
8481
* @param \Illuminate\Support\Collection $categoryIds
8582
* @param \Illuminate\Support\Collection $tagIds
8683
* @param array $excludeIds
87-
* @return Post|null
84+
* @return null|Post
8885
*/
8986
private function getSingleNavigationPost(int $currentPostId, $categoryIds, $tagIds, array $excludeIds = []): ?Post
9087
{
@@ -103,7 +100,7 @@ private function getSingleNavigationPost(int $currentPostId, $categoryIds, $tagI
103100
->with(['slugable', 'categories', 'tags', 'author'])
104101
->inRandomOrder()
105102
->first();
106-
103+
107104
if ($post) {
108105
return $post;
109106
}
@@ -120,7 +117,7 @@ private function getSingleNavigationPost(int $currentPostId, $categoryIds, $tagI
120117
->with(['slugable', 'categories', 'tags', 'author'])
121118
->inRandomOrder()
122119
->first();
123-
120+
124121
if ($post) {
125122
return $post;
126123
}

0 commit comments

Comments
 (0)