Completed
Pull Request — master (#3)
by Guilh
02:22
created
src/Contact.php 1 patch
Indentation   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -8,96 +8,96 @@
 block discarded – undo
8 8
 
9 9
 class Contact extends AbstractModel implements Arrayable
10 10
 {
11
-    use ExtensionPart;
12
-
13
-    /** @var string */
14
-    private $name;
15
-
16
-    /** @var string */
17
-    private $url;
18
-
19
-    /** @var string */
20
-    private $email;
21
-
22
-    public function __construct($contents = [])
23
-    {
24
-        $this->parse($contents);
25
-    }
26
-
27
-    private function parse($contents = [])
28
-    {
29
-        $data = CollectionUtils::toMap($contents);
30
-
31
-        $this->name = $data->get('name');
32
-        $this->url = $data->get('url');
33
-        $this->email = $data->get('email');
34
-
35
-        // extensions
36
-        $this->parseExtensions($data);
37
-    }
38
-
39
-    public function toArray()
40
-    {
41
-        return $this->export('name', 'url', 'email');
42
-    }
43
-
44
-    /**
45
-     * @return string
46
-     */
47
-    public function getName()
48
-    {
49
-        return $this->name;
50
-    }
51
-
52
-    /**
53
-     * @param string $name
54
-     *
55
-     * @return $this
56
-     */
57
-    public function setName($name)
58
-    {
59
-        $this->name = $name;
60
-
61
-        return $this;
62
-    }
63
-
64
-    /**
65
-     * @return string
66
-     */
67
-    public function getUrl()
68
-    {
69
-        return $this->url;
70
-    }
71
-
72
-    /**
73
-     * @param string $url
74
-     *
75
-     * @return $this
76
-     */
77
-    public function setUrl($url)
78
-    {
79
-        $this->url = $url;
80
-
81
-        return $this;
82
-    }
83
-
84
-    /**
85
-     * @return string
86
-     */
87
-    public function getEmail()
88
-    {
89
-        return $this->email;
90
-    }
91
-
92
-    /**
93
-     * @param string $email
94
-     *
95
-     * @return $this
96
-     */
97
-    public function setEmail($email)
98
-    {
99
-        $this->email = $email;
100
-
101
-        return $this;
102
-    }
11
+	use ExtensionPart;
12
+
13
+	/** @var string */
14
+	private $name;
15
+
16
+	/** @var string */
17
+	private $url;
18
+
19
+	/** @var string */
20
+	private $email;
21
+
22
+	public function __construct($contents = [])
23
+	{
24
+		$this->parse($contents);
25
+	}
26
+
27
+	private function parse($contents = [])
28
+	{
29
+		$data = CollectionUtils::toMap($contents);
30
+
31
+		$this->name = $data->get('name');
32
+		$this->url = $data->get('url');
33
+		$this->email = $data->get('email');
34
+
35
+		// extensions
36
+		$this->parseExtensions($data);
37
+	}
38
+
39
+	public function toArray()
40
+	{
41
+		return $this->export('name', 'url', 'email');
42
+	}
43
+
44
+	/**
45
+	 * @return string
46
+	 */
47
+	public function getName()
48
+	{
49
+		return $this->name;
50
+	}
51
+
52
+	/**
53
+	 * @param string $name
54
+	 *
55
+	 * @return $this
56
+	 */
57
+	public function setName($name)
58
+	{
59
+		$this->name = $name;
60
+
61
+		return $this;
62
+	}
63
+
64
+	/**
65
+	 * @return string
66
+	 */
67
+	public function getUrl()
68
+	{
69
+		return $this->url;
70
+	}
71
+
72
+	/**
73
+	 * @param string $url
74
+	 *
75
+	 * @return $this
76
+	 */
77
+	public function setUrl($url)
78
+	{
79
+		$this->url = $url;
80
+
81
+		return $this;
82
+	}
83
+
84
+	/**
85
+	 * @return string
86
+	 */
87
+	public function getEmail()
88
+	{
89
+		return $this->email;
90
+	}
91
+
92
+	/**
93
+	 * @param string $email
94
+	 *
95
+	 * @return $this
96
+	 */
97
+	public function setEmail($email)
98
+	{
99
+		$this->email = $email;
100
+
101
+		return $this;
102
+	}
103 103
 }
Please login to merge, or discard this patch.
src/Response.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -13,70 +13,70 @@
 block discarded – undo
13 13
 
14 14
 class Response extends AbstractModel implements Arrayable
15 15
 {
16
-    use RefPart;
17
-    use DescriptionPart;
18
-    use SchemaPart;
19
-    use ExtensionPart;
16
+	use RefPart;
17
+	use DescriptionPart;
18
+	use SchemaPart;
19
+	use ExtensionPart;
20 20
 
21
-    /** @var string */
22
-    private $code;
21
+	/** @var string */
22
+	private $code;
23 23
 
24
-    /** @var Map */
25
-    private $examples;
24
+	/** @var Map */
25
+	private $examples;
26 26
 
27
-    /** @var Headers */
28
-    private $headers;
27
+	/** @var Headers */
28
+	private $headers;
29 29
 
30
-    public function __construct($code, $contents = [])
31
-    {
32
-        $this->code = $code;
33
-        $this->parse($contents);
34
-    }
30
+	public function __construct($code, $contents = [])
31
+	{
32
+		$this->code = $code;
33
+		$this->parse($contents);
34
+	}
35 35
 
36
-    private function parse($contents)
37
-    {
38
-        $data = CollectionUtils::toMap($contents);
36
+	private function parse($contents)
37
+	{
38
+		$data = CollectionUtils::toMap($contents);
39 39
 
40
-        $this->examples = $data->get('examples', new Map());
41
-        $this->headers = new Headers($data->get('headers'));
40
+		$this->examples = $data->get('examples', new Map());
41
+		$this->headers = new Headers($data->get('headers'));
42 42
 
43
-        // parts
44
-        $this->parseRef($data);
45
-        $this->parseDescription($data);
46
-        $this->parseSchema($data);
47
-        $this->parseExtensions($data);
48
-    }
43
+		// parts
44
+		$this->parseRef($data);
45
+		$this->parseDescription($data);
46
+		$this->parseSchema($data);
47
+		$this->parseExtensions($data);
48
+	}
49 49
 
50
-    public function toArray()
51
-    {
52
-        return $this->export('description', 'schema', 'headers', 'examples');
53
-    }
50
+	public function toArray()
51
+	{
52
+		return $this->export('description', 'schema', 'headers', 'examples');
53
+	}
54 54
 
55
-    /**
56
-     * Returns the responses code.
57
-     * 
58
-     * @return string
59
-     */
60
-    public function getCode()
61
-    {
62
-        return $this->code;
63
-    }
55
+	/**
56
+	 * Returns the responses code.
57
+	 * 
58
+	 * @return string
59
+	 */
60
+	public function getCode()
61
+	{
62
+		return $this->code;
63
+	}
64 64
 
65
-    /**
66
-     * @return Map
67
-     */
68
-    public function getExamples()
69
-    {
70
-        return $this->examples;
71
-    }
65
+	/**
66
+	 * @return Map
67
+	 */
68
+	public function getExamples()
69
+	{
70
+		return $this->examples;
71
+	}
72 72
 
73
-    /**
74
-     * Returns headers for this response.
75
-     * 
76
-     * @return Headers
77
-     */
78
-    public function getHeaders()
79
-    {
80
-        return $this->headers;
81
-    }
73
+	/**
74
+	 * Returns headers for this response.
75
+	 * 
76
+	 * @return Headers
77
+	 */
78
+	public function getHeaders()
79
+	{
80
+		return $this->headers;
81
+	}
82 82
 }
Please login to merge, or discard this patch.
src/Info.php 1 patch
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -10,122 +10,122 @@
 block discarded – undo
10 10
 
11 11
 class Info extends AbstractModel implements Arrayable
12 12
 {
13
-    use DescriptionPart;
14
-    use ExtensionPart;
15
-
16
-    /** @var string */
17
-    private $title;
18
-
19
-    /** @var string */
20
-    private $termsOfService;
21
-
22
-    /** @var Contact */
23
-    private $contact;
24
-
25
-    /** @var License */
26
-    private $license;
27
-
28
-    /** @var string */
29
-    private $version;
30
-
31
-    public function __construct($contents = [])
32
-    {
33
-        $this->parse($contents);
34
-    }
35
-
36
-    private function parse($contents = [])
37
-    {
38
-        $data = CollectionUtils::toMap($contents);
39
-
40
-        $this->title = $data->get('title');
41
-        $this->termsOfService = $data->get('termsOfService');
42
-        $this->contact = new Contact($data->get('contact', new Map()));
43
-        $this->license = new License($data->get('license', new Map()));
44
-        $this->version = $data->get('version');
45
-
46
-        // extensions
47
-        $this->parseDescription($data);
48
-        $this->parseExtensions($data);
49
-    }
50
-
51
-    public function toArray()
52
-    {
53
-        return $this->export('version', 'title', 'description', 'termsOfService', 'contact', 'license');
54
-    }
55
-
56
-    /**
57
-     * @return string
58
-     */
59
-    public function getTitle()
60
-    {
61
-        return $this->title;
62
-    }
63
-
64
-    /**
65
-     * @param string $title
66
-     *
67
-     * @return $this
68
-     */
69
-    public function setTitle($title)
70
-    {
71
-        $this->title = $title;
72
-
73
-        return $this;
74
-    }
75
-
76
-    /**
77
-     * @return string
78
-     */
79
-    public function getTerms()
80
-    {
81
-        return $this->termsOfService;
82
-    }
83
-
84
-    /**
85
-     * @param string $terms
86
-     *
87
-     * @return $this
88
-     */
89
-    public function setTerms($terms)
90
-    {
91
-        $this->termsOfService = $terms;
92
-
93
-        return $this;
94
-    }
95
-
96
-    /**
97
-     * @return Contact
98
-     */
99
-    public function getContact()
100
-    {
101
-        return $this->contact;
102
-    }
103
-
104
-    /**
105
-     * @return License
106
-     */
107
-    public function getLicense()
108
-    {
109
-        return $this->license;
110
-    }
111
-
112
-    /**
113
-     * @return string
114
-     */
115
-    public function getVersion()
116
-    {
117
-        return $this->version;
118
-    }
119
-
120
-    /**
121
-     * @param string $version
122
-     *
123
-     * @return $this
124
-     */
125
-    public function setVersion($version)
126
-    {
127
-        $this->version = $version;
128
-
129
-        return $this;
130
-    }
13
+	use DescriptionPart;
14
+	use ExtensionPart;
15
+
16
+	/** @var string */
17
+	private $title;
18
+
19
+	/** @var string */
20
+	private $termsOfService;
21
+
22
+	/** @var Contact */
23
+	private $contact;
24
+
25
+	/** @var License */
26
+	private $license;
27
+
28
+	/** @var string */
29
+	private $version;
30
+
31
+	public function __construct($contents = [])
32
+	{
33
+		$this->parse($contents);
34
+	}
35
+
36
+	private function parse($contents = [])
37
+	{
38
+		$data = CollectionUtils::toMap($contents);
39
+
40
+		$this->title = $data->get('title');
41
+		$this->termsOfService = $data->get('termsOfService');
42
+		$this->contact = new Contact($data->get('contact', new Map()));
43
+		$this->license = new License($data->get('license', new Map()));
44
+		$this->version = $data->get('version');
45
+
46
+		// extensions
47
+		$this->parseDescription($data);
48
+		$this->parseExtensions($data);
49
+	}
50
+
51
+	public function toArray()
52
+	{
53
+		return $this->export('version', 'title', 'description', 'termsOfService', 'contact', 'license');
54
+	}
55
+
56
+	/**
57
+	 * @return string
58
+	 */
59
+	public function getTitle()
60
+	{
61
+		return $this->title;
62
+	}
63
+
64
+	/**
65
+	 * @param string $title
66
+	 *
67
+	 * @return $this
68
+	 */
69
+	public function setTitle($title)
70
+	{
71
+		$this->title = $title;
72
+
73
+		return $this;
74
+	}
75
+
76
+	/**
77
+	 * @return string
78
+	 */
79
+	public function getTerms()
80
+	{
81
+		return $this->termsOfService;
82
+	}
83
+
84
+	/**
85
+	 * @param string $terms
86
+	 *
87
+	 * @return $this
88
+	 */
89
+	public function setTerms($terms)
90
+	{
91
+		$this->termsOfService = $terms;
92
+
93
+		return $this;
94
+	}
95
+
96
+	/**
97
+	 * @return Contact
98
+	 */
99
+	public function getContact()
100
+	{
101
+		return $this->contact;
102
+	}
103
+
104
+	/**
105
+	 * @return License
106
+	 */
107
+	public function getLicense()
108
+	{
109
+		return $this->license;
110
+	}
111
+
112
+	/**
113
+	 * @return string
114
+	 */
115
+	public function getVersion()
116
+	{
117
+		return $this->version;
118
+	}
119
+
120
+	/**
121
+	 * @param string $version
122
+	 *
123
+	 * @return $this
124
+	 */
125
+	public function setVersion($version)
126
+	{
127
+		$this->version = $version;
128
+
129
+		return $this;
130
+	}
131 131
 }
Please login to merge, or discard this patch.
src/Header.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -12,43 +12,43 @@
 block discarded – undo
12 12
 
13 13
 class Header extends AbstractModel implements Arrayable
14 14
 {
15
-    use DescriptionPart;
16
-    use TypePart;
17
-    use ItemsPart;
18
-    use ExtensionPart;
19
-
20
-    /** @var string */
21
-    private $header;
22
-
23
-    public function __construct($header, $contents = null)
24
-    {
25
-        $this->header = $header;
26
-        $this->parse($contents === null ? new Map() : $contents);
27
-    }
28
-
29
-    private function parse($contents = [])
30
-    {
31
-        $data = CollectionUtils::toMap($contents);
32
-
33
-        // parts
34
-        $this->parseDescription($data);
35
-        $this->parseType($data);
36
-        $this->parseItems($data);
37
-        $this->parseExtensions($data);
38
-    }
39
-
40
-    public function toArray()
41
-    {
42
-        return $this->export('description', $this->getTypeExportFields(), 'items');
43
-    }
44
-
45
-    /**
46
-     * Returns the header.
47
-     * 
48
-     * @return string
49
-     */
50
-    public function getHeader()
51
-    {
52
-        return $this->header;
53
-    }
15
+	use DescriptionPart;
16
+	use TypePart;
17
+	use ItemsPart;
18
+	use ExtensionPart;
19
+
20
+	/** @var string */
21
+	private $header;
22
+
23
+	public function __construct($header, $contents = null)
24
+	{
25
+		$this->header = $header;
26
+		$this->parse($contents === null ? new Map() : $contents);
27
+	}
28
+
29
+	private function parse($contents = [])
30
+	{
31
+		$data = CollectionUtils::toMap($contents);
32
+
33
+		// parts
34
+		$this->parseDescription($data);
35
+		$this->parseType($data);
36
+		$this->parseItems($data);
37
+		$this->parseExtensions($data);
38
+	}
39
+
40
+	public function toArray()
41
+	{
42
+		return $this->export('description', $this->getTypeExportFields(), 'items');
43
+	}
44
+
45
+	/**
46
+	 * Returns the header.
47
+	 * 
48
+	 * @return string
49
+	 */
50
+	public function getHeader()
51
+	{
52
+		return $this->header;
53
+	}
54 54
 }
Please login to merge, or discard this patch.
src/parts/RequiredPart.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@
 block discarded – undo
6 6
 
7 7
 trait RequiredPart
8 8
 {
9
-    /** @var bool */
10
-    private $required = false;
9
+	/** @var bool */
10
+	private $required = false;
11 11
 
12
-    private function parseRequired(Map $data)
13
-    {
14
-        $this->required = $data->has('required') && $data->get('required');
15
-    }
12
+	private function parseRequired(Map $data)
13
+	{
14
+		$this->required = $data->has('required') && $data->get('required');
15
+	}
16 16
 
17
-    /**
18
-     * @return bool
19
-     */
20
-    public function getRequired()
21
-    {
22
-        return $this->required;
23
-    }
17
+	/**
18
+	 * @return bool
19
+	 */
20
+	public function getRequired()
21
+	{
22
+		return $this->required;
23
+	}
24 24
 
25
-    /**
26
-     * @param bool $required
27
-     *
28
-     * @return $this
29
-     */
30
-    public function setRequired($required)
31
-    {
32
-        $this->required = $required;
25
+	/**
26
+	 * @param bool $required
27
+	 *
28
+	 * @return $this
29
+	 */
30
+	public function setRequired($required)
31
+	{
32
+		$this->required = $required;
33 33
 
34
-        return $this;
35
-    }
34
+		return $this;
35
+	}
36 36
 }
Please login to merge, or discard this patch.
src/parts/ProducesPart.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,20 +7,20 @@
 block discarded – undo
7 7
 
8 8
 trait ProducesPart
9 9
 {
10
-    private $produces;
10
+	private $produces;
11 11
 
12
-    private function parseProduces(Map $data)
13
-    {
14
-        $this->produces = $data->get('produces', new Set());
15
-    }
12
+	private function parseProduces(Map $data)
13
+	{
14
+		$this->produces = $data->get('produces', new Set());
15
+	}
16 16
 
17
-    /**
18
-     * Return produces.
19
-     *
20
-     * @return Set
21
-     */
22
-    public function getProduces()
23
-    {
24
-        return $this->produces;
25
-    }
17
+	/**
18
+	 * Return produces.
19
+	 *
20
+	 * @return Set
21
+	 */
22
+	public function getProduces()
23
+	{
24
+		return $this->produces;
25
+	}
26 26
 }
Please login to merge, or discard this patch.
src/parts/SchemesPart.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,20 +7,20 @@
 block discarded – undo
7 7
 
8 8
 trait SchemesPart
9 9
 {
10
-    private $schemes;
10
+	private $schemes;
11 11
 
12
-    private function parseSchemes(Map $data)
13
-    {
14
-        $this->schemes = $data->get('schemes', new ArrayList());
15
-    }
12
+	private function parseSchemes(Map $data)
13
+	{
14
+		$this->schemes = $data->get('schemes', new ArrayList());
15
+	}
16 16
 
17
-    /**
18
-     * Return schemes.
19
-     *
20
-     * @return ArrayList
21
-     */
22
-    public function getSchemes()
23
-    {
24
-        return $this->schemes;
25
-    }
17
+	/**
18
+	 * Return schemes.
19
+	 *
20
+	 * @return ArrayList
21
+	 */
22
+	public function getSchemes()
23
+	{
24
+		return $this->schemes;
25
+	}
26 26
 }
Please login to merge, or discard this patch.
src/parts/UrlPart.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@
 block discarded – undo
6 6
 
7 7
 trait UrlPart
8 8
 {
9
-    /** @var string */
10
-    private $url = false;
9
+	/** @var string */
10
+	private $url = false;
11 11
 
12
-    private function parseUrl(Map $data)
13
-    {
14
-        $this->url = $data->get('url');
15
-    }
12
+	private function parseUrl(Map $data)
13
+	{
14
+		$this->url = $data->get('url');
15
+	}
16 16
 
17
-    /**
18
-     * @return string
19
-     */
20
-    public function getUrl()
21
-    {
22
-        return $this->url;
23
-    }
17
+	/**
18
+	 * @return string
19
+	 */
20
+	public function getUrl()
21
+	{
22
+		return $this->url;
23
+	}
24 24
 
25
-    /**
26
-     * @param string $url
27
-     *
28
-     * @return $this
29
-     */
30
-    public function setUrl($url)
31
-    {
32
-        $this->url = $url;
25
+	/**
26
+	 * @param string $url
27
+	 *
28
+	 * @return $this
29
+	 */
30
+	public function setUrl($url)
31
+	{
32
+		$this->url = $url;
33 33
 
34
-        return $this;
35
-    }
34
+		return $this;
35
+	}
36 36
 }
Please login to merge, or discard this patch.
src/parts/TypePart.php 1 patch
Indentation   +409 added lines, -409 removed lines patch added patch discarded remove patch
@@ -6,413 +6,413 @@
 block discarded – undo
6 6
 
7 7
 trait TypePart
8 8
 {
9
-    /** @var string */
10
-    private $type;
11
-
12
-    /** @var string */
13
-    private $format;
14
-
15
-    /** @var string */
16
-    private $collectionFormat;
17
-
18
-    /** @var mixed */
19
-    private $default;
20
-
21
-    /** @var float */
22
-    private $maximum;
23
-
24
-    /** @var bool */
25
-    private $exclusiveMaximum = false;
26
-
27
-    /** @var float */
28
-    private $minimum;
29
-
30
-    /** @var bool */
31
-    private $exclusiveMinimum = false;
32
-
33
-    /** @var int */
34
-    private $maxLength;
35
-
36
-    /** @var int */
37
-    private $minLength;
38
-
39
-    /** @var string */
40
-    private $pattern;
41
-
42
-    /** @var int */
43
-    private $maxItems;
44
-
45
-    /** @var int */
46
-    private $minItems;
47
-
48
-    /** @var bool */
49
-    private $uniqueItems;
50
-
51
-    /** @var mixed */
52
-    private $enum;
53
-
54
-    /** @var float */
55
-    private $multipleOf;
56
-
57
-    private function parseType(Map $data)
58
-    {
59
-        $this->type = $data->get('type');
60
-        $this->format = $data->get('format');
61
-        $this->collectionFormat = $data->get('collectionFormat');
62
-        $this->default = $data->get('default');
63
-        $this->maximum = $data->get('maximum');
64
-        $this->exclusiveMaximum = $data->has('exclusiveMaximum') && $data->get('exclusiveMaximum');
65
-        $this->minimum = $data->get('minimum');
66
-        $this->exclusiveMinimum = $data->has('exclusiveMinimum') && $data->get('exclusiveMinimum');
67
-        $this->maxLength = $data->get('maxLength');
68
-        $this->minLength = $data->get('minLength');
69
-        $this->pattern = $data->get('pattern');
70
-        $this->maxItems = $data->get('maxItems');
71
-        $this->minItems = $data->get('minItems');
72
-        $this->uniqueItems = $data->has('uniqueItems') && $data->get('uniqueItems');
73
-        $this->enum = $data->get('enum');
74
-        $this->multipleOf = $data->get('multipleOf');
75
-    }
76
-
77
-    private function getTypeExportFields()
78
-    {
79
-        return ['type', 'format', 'collectionFormat', 'default', 'maximum', 'exclusiveMaximum',
80
-            'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'maxItems',
81
-            'minItems', 'uniqueItems', 'enum', 'multipleOf',
82
-        ];
83
-    }
84
-
85
-    /**
86
-     * @return string
87
-     */
88
-    public function getType()
89
-    {
90
-        return $this->type;
91
-    }
92
-
93
-    /**
94
-     * @param string $type
95
-     *
96
-     * @return $this
97
-     */
98
-    public function setType($type)
99
-    {
100
-        $this->type = $type;
101
-
102
-        return $this;
103
-    }
104
-
105
-    /**
106
-     * @return string
107
-     */
108
-    public function getFormat()
109
-    {
110
-        return $this->format;
111
-    }
112
-
113
-    /**
114
-     * Sets the extending format for the type.
115
-     *
116
-     * @param string $format
117
-     *
118
-     * @return $this
119
-     */
120
-    public function setFormat($format)
121
-    {
122
-        $this->format = $format;
123
-
124
-        return $this;
125
-    }
126
-
127
-    /**
128
-     * @return string
129
-     */
130
-    public function getCollectionFormat()
131
-    {
132
-        return $this->collectionFormat;
133
-    }
134
-
135
-    /**
136
-     * Determines the format of the array if type array is used. Possible values are:.
137
-     * 
138
-     * - `csv` - comma separated values `foo,bar`.
139
-     * - `ssv` - space separated values `foo bar`.
140
-     * - `tsv` - tab separated values `foo\tbar`.
141
-     * - `pipes` - pipe separated values `foo|bar`.
142
-     * - `multi` - corresponds to multiple parameter instances instead of multiple values for a 
143
-     * single instance `foo=bar&foo=baz`. This is valid only for parameters in "query" or "formData".
144
-     * 
145
-     * Default value is `csv`.
146
-     * 
147
-     * 
148
-     * @param string $collectionFormat
149
-     *
150
-     * @return $this
151
-     */
152
-    public function setCollectionFormat($collectionFormat)
153
-    {
154
-        $this->collectionFormat = $collectionFormat;
155
-
156
-        return $this;
157
-    }
158
-
159
-    /**
160
-     * @return mixed
161
-     */
162
-    public function getDefault()
163
-    {
164
-        return $this->default;
165
-    }
166
-
167
-    /**
168
-     * @param mixed $default
169
-     *
170
-     * @return $this
171
-     */
172
-    public function setDefault($default)
173
-    {
174
-        $this->default = $default;
175
-
176
-        return $this;
177
-    }
178
-
179
-    /**
180
-     * @return float
181
-     */
182
-    public function getMaximum()
183
-    {
184
-        return $this->maximum;
185
-    }
186
-
187
-    /**
188
-     * @param float $maximum
189
-     *
190
-     * @return $this
191
-     */
192
-    public function setMaximum($maximum)
193
-    {
194
-        $this->maximum = $maximum;
195
-
196
-        return $this;
197
-    }
198
-
199
-    /**
200
-     * @return bool
201
-     */
202
-    public function isExclusiveMaximum()
203
-    {
204
-        return $this->exclusiveMaximum;
205
-    }
206
-
207
-    /**
208
-     * @param bool $exclusiveMaximum
209
-     *
210
-     * @return $this
211
-     */
212
-    public function setExclusiveMaximum($exclusiveMaximum)
213
-    {
214
-        $this->exclusiveMaximum = $exclusiveMaximum;
215
-
216
-        return $this;
217
-    }
218
-
219
-    /**
220
-     * @return float
221
-     */
222
-    public function getMinimum()
223
-    {
224
-        return $this->minimum;
225
-    }
226
-
227
-    /**
228
-     * @param float $minimum
229
-     *
230
-     * @return $this
231
-     */
232
-    public function setMinimum($minimum)
233
-    {
234
-        $this->minimum = $minimum;
235
-
236
-        return $this;
237
-    }
238
-
239
-    /**
240
-     * @return bool
241
-     */
242
-    public function isExclusiveMinimum()
243
-    {
244
-        return $this->exclusiveMinimum;
245
-    }
246
-
247
-    /**
248
-     * @param bool $exclusiveMinimum
249
-     *
250
-     * @return $this
251
-     */
252
-    public function setExclusiveMinimum($exclusiveMinimum)
253
-    {
254
-        $this->exclusiveMinimum = $exclusiveMinimum;
255
-
256
-        return $this;
257
-    }
258
-
259
-    /**
260
-     * @return int
261
-     */
262
-    public function getMaxLength()
263
-    {
264
-        return $this->maxLength;
265
-    }
266
-
267
-    /**
268
-     * @param int $maxLength
269
-     *
270
-     * @return $this
271
-     */
272
-    public function setMaxLength($maxLength)
273
-    {
274
-        $this->maxLength = $maxLength;
275
-
276
-        return $this;
277
-    }
278
-
279
-    /**
280
-     * @return int
281
-     */
282
-    public function getMinLength()
283
-    {
284
-        return $this->minLength;
285
-    }
286
-
287
-    /**
288
-     * @param int $minLength
289
-     *
290
-     * @return $this
291
-     */
292
-    public function setMinLength($minLength)
293
-    {
294
-        $this->minLength = $minLength;
295
-
296
-        return $this;
297
-    }
298
-
299
-    /**
300
-     * @return string
301
-     */
302
-    public function getPattern()
303
-    {
304
-        return $this->pattern;
305
-    }
306
-
307
-    /**
308
-     * @param string $pattern
309
-     *
310
-     * @return $thi
311
-     */
312
-    public function setPattern($pattern)
313
-    {
314
-        $this->pattern = $pattern;
315
-
316
-        return $this;
317
-    }
318
-
319
-    /**
320
-     * @return int
321
-     */
322
-    public function getMaxItems()
323
-    {
324
-        return $this->maxItems;
325
-    }
326
-
327
-    /**
328
-     * @param int $maxItems
329
-     *
330
-     * @return $this
331
-     */
332
-    public function setMaxItems($maxItems)
333
-    {
334
-        $this->maxItems = $maxItems;
335
-
336
-        return $this;
337
-    }
338
-
339
-    /**
340
-     * @return int
341
-     */
342
-    public function getMinItems()
343
-    {
344
-        return $this->minItems;
345
-    }
346
-
347
-    /**
348
-     * @param int $minItems
349
-     *
350
-     * @return $this
351
-     */
352
-    public function setMinItems($minItems)
353
-    {
354
-        $this->minItems = $minItems;
355
-
356
-        return $this;
357
-    }
358
-
359
-    /**
360
-     * @return bool
361
-     */
362
-    public function hasUniqueItems()
363
-    {
364
-        return $this->uniqueItems;
365
-    }
366
-
367
-    /**
368
-     * @param bool $uniqueItems
369
-     *
370
-     * @return $this
371
-     */
372
-    public function setUniqueItems($uniqueItems)
373
-    {
374
-        $this->uniqueItems = $uniqueItems;
375
-
376
-        return $this;
377
-    }
378
-
379
-    /**
380
-     * @return mixed
381
-     */
382
-    public function getEnum()
383
-    {
384
-        return $this->enum;
385
-    }
386
-
387
-    /**
388
-     * @param mixed $enum
389
-     *
390
-     * @return $this
391
-     */
392
-    public function setEnum($enum)
393
-    {
394
-        $this->enum = $enum;
395
-
396
-        return $this;
397
-    }
398
-
399
-    /**
400
-     * @return float
401
-     */
402
-    public function getMultipleOf()
403
-    {
404
-        return $this->multipleOf;
405
-    }
406
-
407
-    /**
408
-     * @param float $multipleOf
409
-     *
410
-     * @return $this
411
-     */
412
-    public function setMultipleOf($multipleOf)
413
-    {
414
-        $this->multipleOf = $multipleOf;
415
-
416
-        return $this;
417
-    }
9
+	/** @var string */
10
+	private $type;
11
+
12
+	/** @var string */
13
+	private $format;
14
+
15
+	/** @var string */
16
+	private $collectionFormat;
17
+
18
+	/** @var mixed */
19
+	private $default;
20
+
21
+	/** @var float */
22
+	private $maximum;
23
+
24
+	/** @var bool */
25
+	private $exclusiveMaximum = false;
26
+
27
+	/** @var float */
28
+	private $minimum;
29
+
30
+	/** @var bool */
31
+	private $exclusiveMinimum = false;
32
+
33
+	/** @var int */
34
+	private $maxLength;
35
+
36
+	/** @var int */
37
+	private $minLength;
38
+
39
+	/** @var string */
40
+	private $pattern;
41
+
42
+	/** @var int */
43
+	private $maxItems;
44
+
45
+	/** @var int */
46
+	private $minItems;
47
+
48
+	/** @var bool */
49
+	private $uniqueItems;
50
+
51
+	/** @var mixed */
52
+	private $enum;
53
+
54
+	/** @var float */
55
+	private $multipleOf;
56
+
57
+	private function parseType(Map $data)
58
+	{
59
+		$this->type = $data->get('type');
60
+		$this->format = $data->get('format');
61
+		$this->collectionFormat = $data->get('collectionFormat');
62
+		$this->default = $data->get('default');
63
+		$this->maximum = $data->get('maximum');
64
+		$this->exclusiveMaximum = $data->has('exclusiveMaximum') && $data->get('exclusiveMaximum');
65
+		$this->minimum = $data->get('minimum');
66
+		$this->exclusiveMinimum = $data->has('exclusiveMinimum') && $data->get('exclusiveMinimum');
67
+		$this->maxLength = $data->get('maxLength');
68
+		$this->minLength = $data->get('minLength');
69
+		$this->pattern = $data->get('pattern');
70
+		$this->maxItems = $data->get('maxItems');
71
+		$this->minItems = $data->get('minItems');
72
+		$this->uniqueItems = $data->has('uniqueItems') && $data->get('uniqueItems');
73
+		$this->enum = $data->get('enum');
74
+		$this->multipleOf = $data->get('multipleOf');
75
+	}
76
+
77
+	private function getTypeExportFields()
78
+	{
79
+		return ['type', 'format', 'collectionFormat', 'default', 'maximum', 'exclusiveMaximum',
80
+			'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'maxItems',
81
+			'minItems', 'uniqueItems', 'enum', 'multipleOf',
82
+		];
83
+	}
84
+
85
+	/**
86
+	 * @return string
87
+	 */
88
+	public function getType()
89
+	{
90
+		return $this->type;
91
+	}
92
+
93
+	/**
94
+	 * @param string $type
95
+	 *
96
+	 * @return $this
97
+	 */
98
+	public function setType($type)
99
+	{
100
+		$this->type = $type;
101
+
102
+		return $this;
103
+	}
104
+
105
+	/**
106
+	 * @return string
107
+	 */
108
+	public function getFormat()
109
+	{
110
+		return $this->format;
111
+	}
112
+
113
+	/**
114
+	 * Sets the extending format for the type.
115
+	 *
116
+	 * @param string $format
117
+	 *
118
+	 * @return $this
119
+	 */
120
+	public function setFormat($format)
121
+	{
122
+		$this->format = $format;
123
+
124
+		return $this;
125
+	}
126
+
127
+	/**
128
+	 * @return string
129
+	 */
130
+	public function getCollectionFormat()
131
+	{
132
+		return $this->collectionFormat;
133
+	}
134
+
135
+	/**
136
+	 * Determines the format of the array if type array is used. Possible values are:.
137
+	 * 
138
+	 * - `csv` - comma separated values `foo,bar`.
139
+	 * - `ssv` - space separated values `foo bar`.
140
+	 * - `tsv` - tab separated values `foo\tbar`.
141
+	 * - `pipes` - pipe separated values `foo|bar`.
142
+	 * - `multi` - corresponds to multiple parameter instances instead of multiple values for a 
143
+	 * single instance `foo=bar&foo=baz`. This is valid only for parameters in "query" or "formData".
144
+	 * 
145
+	 * Default value is `csv`.
146
+	 * 
147
+	 * 
148
+	 * @param string $collectionFormat
149
+	 *
150
+	 * @return $this
151
+	 */
152
+	public function setCollectionFormat($collectionFormat)
153
+	{
154
+		$this->collectionFormat = $collectionFormat;
155
+
156
+		return $this;
157
+	}
158
+
159
+	/**
160
+	 * @return mixed
161
+	 */
162
+	public function getDefault()
163
+	{
164
+		return $this->default;
165
+	}
166
+
167
+	/**
168
+	 * @param mixed $default
169
+	 *
170
+	 * @return $this
171
+	 */
172
+	public function setDefault($default)
173
+	{
174
+		$this->default = $default;
175
+
176
+		return $this;
177
+	}
178
+
179
+	/**
180
+	 * @return float
181
+	 */
182
+	public function getMaximum()
183
+	{
184
+		return $this->maximum;
185
+	}
186
+
187
+	/**
188
+	 * @param float $maximum
189
+	 *
190
+	 * @return $this
191
+	 */
192
+	public function setMaximum($maximum)
193
+	{
194
+		$this->maximum = $maximum;
195
+
196
+		return $this;
197
+	}
198
+
199
+	/**
200
+	 * @return bool
201
+	 */
202
+	public function isExclusiveMaximum()
203
+	{
204
+		return $this->exclusiveMaximum;
205
+	}
206
+
207
+	/**
208
+	 * @param bool $exclusiveMaximum
209
+	 *
210
+	 * @return $this
211
+	 */
212
+	public function setExclusiveMaximum($exclusiveMaximum)
213
+	{
214
+		$this->exclusiveMaximum = $exclusiveMaximum;
215
+
216
+		return $this;
217
+	}
218
+
219
+	/**
220
+	 * @return float
221
+	 */
222
+	public function getMinimum()
223
+	{
224
+		return $this->minimum;
225
+	}
226
+
227
+	/**
228
+	 * @param float $minimum
229
+	 *
230
+	 * @return $this
231
+	 */
232
+	public function setMinimum($minimum)
233
+	{
234
+		$this->minimum = $minimum;
235
+
236
+		return $this;
237
+	}
238
+
239
+	/**
240
+	 * @return bool
241
+	 */
242
+	public function isExclusiveMinimum()
243
+	{
244
+		return $this->exclusiveMinimum;
245
+	}
246
+
247
+	/**
248
+	 * @param bool $exclusiveMinimum
249
+	 *
250
+	 * @return $this
251
+	 */
252
+	public function setExclusiveMinimum($exclusiveMinimum)
253
+	{
254
+		$this->exclusiveMinimum = $exclusiveMinimum;
255
+
256
+		return $this;
257
+	}
258
+
259
+	/**
260
+	 * @return int
261
+	 */
262
+	public function getMaxLength()
263
+	{
264
+		return $this->maxLength;
265
+	}
266
+
267
+	/**
268
+	 * @param int $maxLength
269
+	 *
270
+	 * @return $this
271
+	 */
272
+	public function setMaxLength($maxLength)
273
+	{
274
+		$this->maxLength = $maxLength;
275
+
276
+		return $this;
277
+	}
278
+
279
+	/**
280
+	 * @return int
281
+	 */
282
+	public function getMinLength()
283
+	{
284
+		return $this->minLength;
285
+	}
286
+
287
+	/**
288
+	 * @param int $minLength
289
+	 *
290
+	 * @return $this
291
+	 */
292
+	public function setMinLength($minLength)
293
+	{
294
+		$this->minLength = $minLength;
295
+
296
+		return $this;
297
+	}
298
+
299
+	/**
300
+	 * @return string
301
+	 */
302
+	public function getPattern()
303
+	{
304
+		return $this->pattern;
305
+	}
306
+
307
+	/**
308
+	 * @param string $pattern
309
+	 *
310
+	 * @return $thi
311
+	 */
312
+	public function setPattern($pattern)
313
+	{
314
+		$this->pattern = $pattern;
315
+
316
+		return $this;
317
+	}
318
+
319
+	/**
320
+	 * @return int
321
+	 */
322
+	public function getMaxItems()
323
+	{
324
+		return $this->maxItems;
325
+	}
326
+
327
+	/**
328
+	 * @param int $maxItems
329
+	 *
330
+	 * @return $this
331
+	 */
332
+	public function setMaxItems($maxItems)
333
+	{
334
+		$this->maxItems = $maxItems;
335
+
336
+		return $this;
337
+	}
338
+
339
+	/**
340
+	 * @return int
341
+	 */
342
+	public function getMinItems()
343
+	{
344
+		return $this->minItems;
345
+	}
346
+
347
+	/**
348
+	 * @param int $minItems
349
+	 *
350
+	 * @return $this
351
+	 */
352
+	public function setMinItems($minItems)
353
+	{
354
+		$this->minItems = $minItems;
355
+
356
+		return $this;
357
+	}
358
+
359
+	/**
360
+	 * @return bool
361
+	 */
362
+	public function hasUniqueItems()
363
+	{
364
+		return $this->uniqueItems;
365
+	}
366
+
367
+	/**
368
+	 * @param bool $uniqueItems
369
+	 *
370
+	 * @return $this
371
+	 */
372
+	public function setUniqueItems($uniqueItems)
373
+	{
374
+		$this->uniqueItems = $uniqueItems;
375
+
376
+		return $this;
377
+	}
378
+
379
+	/**
380
+	 * @return mixed
381
+	 */
382
+	public function getEnum()
383
+	{
384
+		return $this->enum;
385
+	}
386
+
387
+	/**
388
+	 * @param mixed $enum
389
+	 *
390
+	 * @return $this
391
+	 */
392
+	public function setEnum($enum)
393
+	{
394
+		$this->enum = $enum;
395
+
396
+		return $this;
397
+	}
398
+
399
+	/**
400
+	 * @return float
401
+	 */
402
+	public function getMultipleOf()
403
+	{
404
+		return $this->multipleOf;
405
+	}
406
+
407
+	/**
408
+	 * @param float $multipleOf
409
+	 *
410
+	 * @return $this
411
+	 */
412
+	public function setMultipleOf($multipleOf)
413
+	{
414
+		$this->multipleOf = $multipleOf;
415
+
416
+		return $this;
417
+	}
418 418
 }
Please login to merge, or discard this patch.