Conditions | 4 |
Paths | 5 |
Total Lines | 22 |
Lines | 22 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
44 | public function render() |
||
45 | { |
||
46 | $content = call_user_func($this->grid->header(), $this->queryBuilder()); |
||
47 | |||
48 | if (empty($content)) { |
||
49 | return ''; |
||
50 | } |
||
51 | |||
52 | if ($content instanceof Renderable) { |
||
53 | $content = $content->render(); |
||
54 | } |
||
55 | |||
56 | if ($content instanceof Htmlable) { |
||
57 | $content = $content->toHtml(); |
||
58 | } |
||
59 | |||
60 | return <<<HTML |
||
61 | <div class="box-header with-border clearfix"> |
||
62 | {$content} |
||
63 | </div> |
||
64 | HTML; |
||
65 | } |
||
66 | } |
||
67 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.