Completed
Pull Request — master (#3)
by Guilh
02:22
created
src/collections/Responses.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,13 +16,11 @@  discard block
 block discarded – undo
16 16
     /** @var Map */
17 17
     private $responses;
18 18
 
19
-    public function __construct($contents = [])
20
-    {
19
+    public function __construct($contents = []) {
21 20
         $this->parse($contents === null ? [] : $contents);
22 21
     }
23 22
 
24
-    private function parse($contents)
25
-    {
23
+    private function parse($contents) {
26 24
         $data = CollectionUtils::toMap($contents);
27 25
 
28 26
         // responses
@@ -37,16 +35,14 @@  discard block
 block discarded – undo
37 35
         $this->parseExtensions($data);
38 36
     }
39 37
 
40
-    public function toArray()
41
-    {
38
+    public function toArray() {
42 39
         $responses = clone $this->responses;
43 40
         $responses->setAll($this->getExtensions());
44 41
 
45 42
         return $responses->toArray();
46 43
     }
47 44
 
48
-    public function size()
49
-    {
45
+    public function size() {
50 46
         return $this->responses->size();
51 47
     }
52 48
 
@@ -57,8 +53,7 @@  discard block
 block discarded – undo
57 53
      *
58 54
      * @return bool
59 55
      */
60
-    public function has($code)
61
-    {
56
+    public function has($code) {
62 57
         return $this->responses->has($code);
63 58
     }
64 59
 
@@ -69,8 +64,7 @@  discard block
 block discarded – undo
69 64
      *
70 65
      * @return bool
71 66
      */
72
-    public function contains(Response $response)
73
-    {
67
+    public function contains(Response $response) {
74 68
         return $this->responses->contains($response);
75 69
     }
76 70
 
@@ -81,8 +75,7 @@  discard block
 block discarded – undo
81 75
      *
82 76
      * @return Response
83 77
      */
84
-    public function get($code)
85
-    {
78
+    public function get($code) {
86 79
         if (!$this->responses->has($code)) {
87 80
             $this->responses->set($code, new Response($code));
88 81
         }
@@ -95,8 +88,7 @@  discard block
 block discarded – undo
95 88
      * 
96 89
      * @param Response $code
97 90
      */
98
-    public function add(Response $response)
99
-    {
91
+    public function add(Response $response) {
100 92
         $this->responses->set($response->getCode(), $response);
101 93
     }
102 94
 
@@ -105,33 +97,27 @@  discard block
 block discarded – undo
105 97
      * 
106 98
      * @param string $code
107 99
      */
108
-    public function remove($code)
109
-    {
100
+    public function remove($code) {
110 101
         $this->responses->remove($code);
111 102
     }
112 103
 
113
-    public function current()
114
-    {
104
+    public function current() {
115 105
         return $this->responses->current();
116 106
     }
117 107
 
118
-    public function key()
119
-    {
108
+    public function key() {
120 109
         return $this->responses->key();
121 110
     }
122 111
 
123
-    public function next()
124
-    {
112
+    public function next() {
125 113
         return $this->responses->next();
126 114
     }
127 115
 
128
-    public function rewind()
129
-    {
116
+    public function rewind() {
130 117
         return $this->responses->rewind();
131 118
     }
132 119
 
133
-    public function valid()
134
-    {
120
+    public function valid() {
135 121
         return $this->responses->valid();
136 122
     }
137 123
 }
Please login to merge, or discard this patch.
src/collections/Parameters.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -15,13 +15,11 @@  discard block
 block discarded – undo
15 15
     /** @var ArrayList */
16 16
     private $parameters;
17 17
 
18
-    public function __construct($contents = [])
19
-    {
18
+    public function __construct($contents = []) {
20 19
         $this->parse($contents === null ? [] : $contents);
21 20
     }
22 21
 
23
-    private function parse($contents)
24
-    {
22
+    private function parse($contents) {
25 23
         $data = CollectionUtils::toMap($contents);
26 24
 
27 25
         $this->parameters = new ArrayList();
@@ -34,8 +32,7 @@  discard block
 block discarded – undo
34 32
         }
35 33
     }
36 34
 
37
-    public function toArray()
38
-    {
35
+    public function toArray() {
39 36
         if ($this->hasRef()) {
40 37
             return ['$ref' => $this->getRef()];
41 38
         }
@@ -43,8 +40,7 @@  discard block
 block discarded – undo
43 40
         return $this->parameters->toArray();
44 41
     }
45 42
 
46
-    public function size()
47
-    {
43
+    public function size() {
48 44
         return $this->parameters->size();
49 45
     }
50 46
 
@@ -55,8 +51,7 @@  discard block
 block discarded – undo
55 51
      *
56 52
      * @return bool
57 53
      */
58
-    public function searchByName($name)
59
-    {
54
+    public function searchByName($name) {
60 55
         return $this->parameters->search($name, function (Parameter $param, $name) {
61 56
             return $param->getName() == $name;
62 57
         });
@@ -69,8 +64,7 @@  discard block
 block discarded – undo
69 64
      *
70 65
      * @return Parameter|void
71 66
      */
72
-    public function findByName($name)
73
-    {
67
+    public function findByName($name) {
74 68
         foreach ($this->parameters as $param) {
75 69
             if ($param->getName() == $name) {
76 70
                 return $param;
@@ -86,8 +80,7 @@  discard block
 block discarded – undo
86 80
      *
87 81
      * @return Parameter
88 82
      */
89
-    public function getByName($name)
90
-    {
83
+    public function getByName($name) {
91 84
         $param = $this->findByName($name);
92 85
         if (empty($param)) {
93 86
             $param = new Parameter();
@@ -103,8 +96,7 @@  discard block
 block discarded – undo
103 96
      * 
104 97
      * @param Parameter $param
105 98
      */
106
-    public function add(Parameter $param)
107
-    {
99
+    public function add(Parameter $param) {
108 100
         $this->parameters->add($param);
109 101
     }
110 102
 
@@ -113,8 +105,7 @@  discard block
 block discarded – undo
113 105
      * 
114 106
      * @param Parameter $param
115 107
      */
116
-    public function remove(Parameter $param)
117
-    {
108
+    public function remove(Parameter $param) {
118 109
         $this->parameters->remove($param);
119 110
     }
120 111
 
@@ -125,33 +116,27 @@  discard block
 block discarded – undo
125 116
      *
126 117
      * @return bool
127 118
      */
128
-    public function contains(Parameter $param)
129
-    {
119
+    public function contains(Parameter $param) {
130 120
         return $this->parameters->contains($param);
131 121
     }
132 122
 
133
-    public function current()
134
-    {
123
+    public function current() {
135 124
         return $this->parameters->current();
136 125
     }
137 126
 
138
-    public function key()
139
-    {
127
+    public function key() {
140 128
         return $this->parameters->key();
141 129
     }
142 130
 
143
-    public function next()
144
-    {
131
+    public function next() {
145 132
         return $this->parameters->next();
146 133
     }
147 134
 
148
-    public function rewind()
149
-    {
135
+    public function rewind() {
150 136
         return $this->parameters->rewind();
151 137
     }
152 138
 
153
-    public function valid()
154
-    {
139
+    public function valid() {
155 140
         return $this->parameters->valid();
156 141
     }
157 142
 }
Please login to merge, or discard this patch.
src/collections/Headers.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,13 +12,11 @@  discard block
 block discarded – undo
12 12
     /** @var Map */
13 13
     private $headers;
14 14
 
15
-    public function __construct($contents = [])
16
-    {
15
+    public function __construct($contents = []) {
17 16
         $this->parse($contents === null ? [] : $contents);
18 17
     }
19 18
 
20
-    private function parse($contents)
21
-    {
19
+    private function parse($contents) {
22 20
         $data = CollectionUtils::toMap($contents);
23 21
 
24 22
         // headers
@@ -28,13 +26,11 @@  discard block
 block discarded – undo
28 26
         }
29 27
     }
30 28
 
31
-    public function toArray()
32
-    {
29
+    public function toArray() {
33 30
         return $this->headers->toArray();
34 31
     }
35 32
 
36
-    public function size()
37
-    {
33
+    public function size() {
38 34
         return $this->headers->size();
39 35
     }
40 36
 
@@ -45,8 +41,7 @@  discard block
 block discarded – undo
45 41
      *
46 42
      * @return bool
47 43
      */
48
-    public function has($header)
49
-    {
44
+    public function has($header) {
50 45
         return $this->headers->has($header);
51 46
     }
52 47
 
@@ -57,8 +52,7 @@  discard block
 block discarded – undo
57 52
      *
58 53
      * @return bool
59 54
      */
60
-    public function contains(Header $header)
61
-    {
55
+    public function contains(Header $header) {
62 56
         return $this->headers->contains($header);
63 57
     }
64 58
 
@@ -69,8 +63,7 @@  discard block
 block discarded – undo
69 63
      *
70 64
      * @return Header
71 65
      */
72
-    public function get($header)
73
-    {
66
+    public function get($header) {
74 67
         return $this->headers->get($header);
75 68
     }
76 69
 
@@ -79,8 +72,7 @@  discard block
 block discarded – undo
79 72
      * 
80 73
      * @param Header $header
81 74
      */
82
-    public function add(Header $header)
83
-    {
75
+    public function add(Header $header) {
84 76
         $this->headers->set($header->getHeader(), $header);
85 77
     }
86 78
 
@@ -89,33 +81,27 @@  discard block
 block discarded – undo
89 81
      * 
90 82
      * @param string $header
91 83
      */
92
-    public function remove($header)
93
-    {
84
+    public function remove($header) {
94 85
         $this->headers->remove($header);
95 86
     }
96 87
 
97
-    public function current()
98
-    {
88
+    public function current() {
99 89
         return $this->headers->current();
100 90
     }
101 91
 
102
-    public function key()
103
-    {
92
+    public function key() {
104 93
         return $this->headers->key();
105 94
     }
106 95
 
107
-    public function next()
108
-    {
96
+    public function next() {
109 97
         return $this->headers->next();
110 98
     }
111 99
 
112
-    public function rewind()
113
-    {
100
+    public function rewind() {
114 101
         return $this->headers->rewind();
115 102
     }
116 103
 
117
-    public function valid()
118
-    {
104
+    public function valid() {
119 105
         return $this->headers->valid();
120 106
     }
121 107
 }
Please login to merge, or discard this patch.
src/collections/Paths.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,13 +16,11 @@  discard block
 block discarded – undo
16 16
     /** @var Map */
17 17
     private $paths;
18 18
 
19
-    public function __construct($contents = [])
20
-    {
19
+    public function __construct($contents = []) {
21 20
         $this->parse($contents === null ? [] : $contents);
22 21
     }
23 22
 
24
-    private function parse($contents)
25
-    {
23
+    private function parse($contents) {
26 24
         $data = CollectionUtils::toMap($contents);
27 25
 
28 26
         // paths
@@ -37,15 +35,13 @@  discard block
 block discarded – undo
37 35
         $this->parseExtensions($data);
38 36
     }
39 37
 
40
-    public function toArray()
41
-    {
38
+    public function toArray() {
42 39
         $paths = clone $this->paths;
43 40
 // 		$paths->setAll($this->getExtensions());
44 41
         return $paths->toArray();
45 42
     }
46 43
 
47
-    public function size()
48
-    {
44
+    public function size() {
49 45
         return $this->paths->size();
50 46
     }
51 47
 
@@ -56,8 +52,7 @@  discard block
 block discarded – undo
56 52
      *
57 53
      * @return bool
58 54
      */
59
-    public function has($path)
60
-    {
55
+    public function has($path) {
61 56
         return $this->paths->has($path);
62 57
     }
63 58
 
@@ -68,8 +63,7 @@  discard block
 block discarded – undo
68 63
      *
69 64
      * @return bool
70 65
      */
71
-    public function contains(Path $path)
72
-    {
66
+    public function contains(Path $path) {
73 67
         return $this->paths->contains($path);
74 68
     }
75 69
 
@@ -80,8 +74,7 @@  discard block
 block discarded – undo
80 74
      *
81 75
      * @return Path
82 76
      */
83
-    public function get($path)
84
-    {
77
+    public function get($path) {
85 78
         if (!$this->paths->has($path)) {
86 79
             $this->paths->set($path, new Path($path));
87 80
         }
@@ -96,8 +89,7 @@  discard block
 block discarded – undo
96 89
      *
97 90
      * @return $this
98 91
      */
99
-    public function add(Path $path)
100
-    {
92
+    public function add(Path $path) {
101 93
         $this->paths->set($path->getPath(), $path);
102 94
 
103 95
         return $this;
@@ -108,35 +100,29 @@  discard block
 block discarded – undo
108 100
      * 
109 101
      * @param string $path
110 102
      */
111
-    public function remove($path)
112
-    {
103
+    public function remove($path) {
113 104
         $this->paths->remove($path);
114 105
 
115 106
         return $this;
116 107
     }
117 108
 
118
-    public function current()
119
-    {
109
+    public function current() {
120 110
         return $this->paths->current();
121 111
     }
122 112
 
123
-    public function key()
124
-    {
113
+    public function key() {
125 114
         return $this->paths->key();
126 115
     }
127 116
 
128
-    public function next()
129
-    {
117
+    public function next() {
130 118
         return $this->paths->next();
131 119
     }
132 120
 
133
-    public function rewind()
134
-    {
121
+    public function rewind() {
135 122
         return $this->paths->rewind();
136 123
     }
137 124
 
138
-    public function valid()
139
-    {
125
+    public function valid() {
140 126
         return $this->paths->valid();
141 127
     }
142 128
 }
Please login to merge, or discard this patch.
src/ExternalDocs.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,19 +8,16 @@  discard block
 block discarded – undo
8 8
 use gossi\swagger\parts\DescriptionPart;
9 9
 use gossi\swagger\parts\UrlPart;
10 10
 
11
-class ExternalDocs extends AbstractModel implements Arrayable
12
-{
11
+class ExternalDocs extends AbstractModel implements Arrayable {
13 12
     use DescriptionPart;
14 13
     use UrlPart;
15 14
     use ExtensionPart;
16 15
 
17
-    public function __construct($contents = [])
18
-    {
16
+    public function __construct($contents = []) {
19 17
         $this->parse($contents);
20 18
     }
21 19
 
22
-    private function parse($contents = [])
23
-    {
20
+    private function parse($contents = []) {
24 21
         $data = CollectionUtils::toMap($contents);
25 22
 
26 23
         // parts
@@ -29,8 +26,7 @@  discard block
 block discarded – undo
29 26
         $this->parseExtensions($data);
30 27
     }
31 28
 
32
-    public function toArray()
33
-    {
29
+    public function toArray() {
34 30
         return $this->export('description', 'url');
35 31
     }
36 32
 }
Please login to merge, or discard this patch.