Skip to content

Commit 70acf9d

Browse files
committed
Use wrapped object for presenter
1 parent a77f548 commit 70acf9d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/Forum/Replies/ReplyPresenter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<?php
22
namespace Lio\Forum\Replies;
33

4-
use App;
54
use Input;
65
use McCool\LaravelAutoPresenter\BasePresenter;
6+
use Misd\Linkify\Linkify;
77
use Request;
88

99
class ReplyPresenter extends BasePresenter
1010
{
1111
public function url()
1212
{
13-
$slug = $this->thread->slug;
14-
$threadUrl = action('Forum\ForumThreadsController@getShowThread', [$slug]);
15-
return $threadUrl . \App::make('Lio\Forum\Replies\ReplyQueryStringGenerator')->generate($this->getWrappedObject());
13+
$slug = $this->getWrappedObject()->thread->slug;
14+
$threadUrl = action('Forum\ForumThreadsController@getShowThread', $slug);
15+
16+
return $threadUrl . app(ReplyQueryStringGenerator::class)->generate($this->getWrappedObject());
1617
}
1718

1819
public function created_ago()
@@ -35,21 +36,20 @@ public function body()
3536
return $body;
3637
}
3738

38-
// ------------------- //
39-
4039
private function convertMarkdown($content)
4140
{
42-
return App::make('Lio\Markdown\HtmlMarkdownConvertor')->convertMarkdownToHtml($content);
41+
return app('Lio\Markdown\HtmlMarkdownConvertor')->convertMarkdownToHtml($content);
4342
}
4443

4544
private function formatGists($content)
4645
{
47-
return App::make('Lio\Github\GistEmbedFormatter')->format($content);
46+
return app('Lio\Github\GistEmbedFormatter')->format($content);
4847
}
4948

5049
private function linkify($content)
5150
{
52-
$linkify = new \Misd\Linkify\Linkify();
51+
$linkify = new Linkify();
52+
5353
return $linkify->process($content);
5454
}
5555
}

0 commit comments

Comments
 (0)