Completed
Push — master ( f143cd...4c4bcb )
by Bradley
02:39
created

Rectangle::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
rs 10
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 Rectangle implements ModelingInterface {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
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::rectangle')
0 ignored issues
show
Bug introduced by
The method withOptions() does not seem to exist on object<Illuminate\Contracts\View\View>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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