These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php namespace Cornford\Googlmapper\Models; |
||
2 | |||
3 | use Cornford\Googlmapper\Contracts\ModelingInterface; |
||
4 | use Illuminate\View\Factory as View; |
||
5 | |||
6 | View Code Duplication | class Polygon implements ModelingInterface { |
|
0 ignored issues
–
show
|
|||
7 | |||
8 | /** |
||
9 | * Options. |
||
10 | * |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $options = []; |
||
14 | |||
15 | /** |
||
16 | * Public constructor. |
||
17 | * |
||
18 | * @param array $parameters |
||
19 | */ |
||
20 | public function __construct(array $parameters = []) |
||
21 | { |
||
22 | $this->options = $parameters; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Render the model item. |
||
27 | * |
||
28 | * @param integer $identifier |
||
29 | * @param View $view |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | public function render($identifier, View $view) |
||
34 | { |
||
35 | return $view->make('googlmapper::polygon') |
||
36 | ->withOptions($this->options) |
||
37 | ->withId($identifier) |
||
38 | ->render(); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get the model options. |
||
43 | * |
||
44 | * @return array |
||
45 | */ |
||
46 | public function getOptions() |
||
47 | { |
||
48 | return $this->options; |
||
49 | } |
||
50 | |||
51 | } |
||
52 |
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.