Completed
Push — master ( 0ef921...49b538 )
by Martijn
03:08
created

ParameterReference::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SwaggerGen\Swagger;
4
5
/**
6
 * Describes a reference to a Parameter.
7
 *
8
 * @package    SwaggerGen
9
 * @author     Martijn van der Lee <[email protected]>
10
 * @copyright  2014-2016 Martijn van der Lee
11
 * @license    https://opensource.org/licenses/MIT MIT
12
 */
13 View Code Duplication
class ParameterReference extends AbstractObject implements IParameter
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...
14
{
15
16
	private $reference = '';
17
18
	public function __construct(AbstractObject $parent, $reference)
19
	{
20
		parent::__construct($parent);
21
22
		$this->reference = $reference;
23
	}
24
25
	public function toArray()
26
	{
27
		return self::arrayFilterNull(array(
28
					'$ref' => '#/parameters/' . $this->reference,
29
		));
30
	}
31
32
	public function __toString()
33
	{
34
		return __CLASS__ . " {$this->reference}";
35
	}
36
37
	public function getName()
38
	{
39
		return $this->reference;
40
	}
41
42
}
43