Skip to content

Commit

Permalink
Apply fixes from StyleCI (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj authored Dec 27, 2020
1 parent 19cb5d7 commit c5bef7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function store(PostRequest $request, $id): JsonResponse
->with('tags', 'topic')
->find($id);

if (!$post) {
if (! $post) {
$post = new Post(['id' => $id]);
}

Expand All @@ -117,7 +117,7 @@ public function store(PostRequest $request, $id): JsonResponse
$tagsToSync = collect($request->input('tags', []))->map(function ($item) use ($tags) {
$tag = $tags->firstWhere('slug', $item['slug']);

if (!$tag) {
if (! $tag) {
$tag = Tag::create([
'id' => $id = Uuid::uuid4()->toString(),
'name' => $item['name'],
Expand All @@ -126,13 +126,13 @@ public function store(PostRequest $request, $id): JsonResponse
]);
}

return (string)$tag->id;
return (string) $tag->id;
})->toArray();

$topicToSync = collect($request->input('topic', []))->map(function ($item) use ($topics) {
$topic = $topics->firstWhere('slug', $item['slug']);

if (!$topic) {
if (! $topic) {
$topic = Topic::create([
'id' => $id = Uuid::uuid4()->toString(),
'name' => $item['name'],
Expand All @@ -141,7 +141,7 @@ public function store(PostRequest $request, $id): JsonResponse
]);
}

return (string)$topic->id;
return (string) $topic->id;
})->toArray();

$post->tags()->sync($tagsToSync);
Expand Down

0 comments on commit c5bef7e

Please sign in to comment.