Completed
Push — master ( f90246...088bf6 )
by Martijn
14s
created
SwaggerGen/Swagger/Operation.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -35,6 +35,9 @@
 block discarded – undo
35 35
 		return $this->consumes;
36 36
 	}
37 37
 
38
+	/**
39
+	 * @param string $summary
40
+	 */
38 41
 	public function __construct(AbstractObject $parent, $summary = null, Tag $tag = null)
39 42
 	{
40 43
 		parent::__construct($parent);
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Parameter.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 		$format = strtolower($match[1]);
99 99
 		if (isset(self::$classTypes[$format])) {
100 100
 			$type = self::$classTypes[$format];
101
-			$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
101
+			$class = "SwaggerGen\\Swagger\\Type\\{$type}type";
102 102
 			$this->Type = new $class($this, $definition);
103 103
 		} else {
104 104
 			throw new \SwaggerGen\Exception("Type format not recognized: '{$format}'");
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/ArrayType.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
 		$format = strtolower($match[1]);
166 166
 		if (isset(self::$classTypes[$format])) {
167 167
 			$type = self::$classTypes[$format];
168
-			$typeClass = "SwaggerGen\\Swagger\\Type\\{$type}Type";
168
+			$typeClass = "SwaggerGen\\Swagger\\Type\\{$type}type";
169 169
 			return new $typeClass($this, $items);
170 170
 		}
171 171
 
Please login to merge, or discard this patch.
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -69,6 +69,10 @@  discard block
 block discarded – undo
69 69
 		$this->parseRange($definition, $match);
70 70
 	}
71 71
 
72
+	/**
73
+	 * @param string $definition
74
+	 * @param string[] $match
75
+	 */
72 76
 	private function parseFormat($definition, $match)
73 77
 	{
74 78
 		$type = strtolower($match[1]);
@@ -86,6 +90,10 @@  discard block
 block discarded – undo
86 90
 		$this->collectionFormat = self::$collectionFormats[$type];
87 91
 	}
88 92
 
93
+	/**
94
+	 * @param string $definition
95
+	 * @param string[] $match
96
+	 */
89 97
 	private function parseItems($definition, $match)
90 98
 	{
91 99
 		if (!empty($match[2])) {
@@ -93,6 +101,10 @@  discard block
 block discarded – undo
93 101
 		}
94 102
 	}
95 103
 
104
+	/**
105
+	 * @param string $definition
106
+	 * @param string[] $match
107
+	 */
96 108
 	private function parseRange($definition, $match)
97 109
 	{
98 110
 		if (!empty($match[3])) {
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/NumberType.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -41,6 +41,9 @@  discard block
 block discarded – undo
41 41
 		$this->parseDefault($definition, $match);
42 42
 	}
43 43
 
44
+	/**
45
+	 * @param string[] $match
46
+	 */
44 47
 	private function parseFormat($definition, $match)
45 48
 	{
46 49
 		if (!isset(self::$formats[strtolower($match[1])])) {
@@ -49,6 +52,9 @@  discard block
 block discarded – undo
49 52
 		$this->format = self::$formats[strtolower($match[1])];
50 53
 	}
51 54
 
55
+	/**
56
+	 * @param string[] $match
57
+	 */
52 58
 	private function parseRange($definition, $match)
53 59
 	{
54 60
 		if (!empty($match[2])) {
@@ -67,6 +73,9 @@  discard block
 block discarded – undo
67 73
 		}
68 74
 	}
69 75
 
76
+	/**
77
+	 * @param string[] $match
78
+	 */
70 79
 	private function parseDefault($definition, $match)
71 80
 	{
72 81
 		$this->default = isset($match[6]) && $match[6] !== '' ? $this->validateDefault($match[6]) : null;
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/IntegerType.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -81,6 +81,10 @@
 block discarded – undo
81 81
 		}
82 82
 	}
83 83
 
84
+	/**
85
+	 * @param string $definition
86
+	 * @param string[] $match
87
+	 */
84 88
 	private function parseDefault($definition, $match)
85 89
 	{
86 90
 		$this->default = isset($match[6]) && $match[6] !== '' ? $this->validateDefault($match[6]) : null;
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Schema.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 			// Internal type if type known and not overwritten by definition
73 73
 			if (isset(self::$classTypes[$format])) {
74 74
 				$type = self::$classTypes[$format];
75
-				$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
75
+				$class = "SwaggerGen\\Swagger\\Type\\{$type}type";
76 76
 				$this->type = new $class($this, $definition);
77 77
 			} else {
78 78
 				$this->type = new Type\ReferenceObjectType($this, $definition);
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	private $title = null;
53 53
 
54
-    /**
55
-     * @var bool
56
-     */
57
-    private $readOnly = null;
54
+	/**
55
+	 * @var bool
56
+	 */
57
+	private $readOnly = null;
58 58
 
59 59
 	/**
60 60
 	 * @var \SwaggerGen\Swagger\Type\AbstractType
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		return self::arrayFilterNull(array_merge($this->type->toArray(), array(
119 119
 					'title' => empty($this->title) ? null : $this->title,
120 120
 					'description' => empty($this->description) ? null : $this->description,
121
-                    'readOnly' => $this->readOnly
121
+					'readOnly' => $this->readOnly
122 122
 								), parent::toArray()));
123 123
 	}
124 124
 
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 		return __CLASS__;
128 128
 	}
129 129
 
130
-    public function setReadOnly()
131
-    {
132
-        $this->readOnly = true;
133
-    }
130
+	public function setReadOnly()
131
+	{
132
+		$this->readOnly = true;
133
+	}
134 134
 
135 135
 }
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/AbstractRegexType.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$match = array();
47 47
 		if (preg_match(self::REGEX_START . self::REGEX_FORMAT . self::REGEX_DEFAULT_START . $this->regex . self::REGEX_DEFAULT_END . self::REGEX_END, $definition, $match) !== 1) {
48
-			throw new \SwaggerGen\Exception("Unparseable {$this->format} definition: '{$definition}'");
48
+			throw new \SwaggerGen\Exception("unparseable {$this->format} definition: '{$definition}'");
49 49
 		}
50 50
 
51 51
 		if (strtolower($match[1] !== $this->format)) {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		$value = parent::validateDefault($value);
62 62
 		
63 63
 		if (preg_match('/' . $this->pattern . '/', $value) !== 1) {
64
-			throw new \SwaggerGen\Exception("Invalid {$this->format} default value");
64
+			throw new \SwaggerGen\Exception("invalid {$this->format} default value");
65 65
 		}
66 66
 		
67 67
 		return $value;
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/StringType.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	{
162 162
 		if (empty($value)) {
163 163
 			$type = $this->format ?: ($this->enum ? 'enum' : 'string');
164
-			throw new \SwaggerGen\Exception("Empty {$type} default");
164
+			throw new \SwaggerGen\Exception("empty {$type} default");
165 165
 		}
166 166
 
167 167
 		if (!empty($this->enum) && !in_array($value, $this->enum)) {
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 
171 171
 		if ($this->maxLength !== null && mb_strlen($value) > $this->maxLength) {
172 172
 			$type = $this->format ?: ($this->enum ? 'enum' : 'string');
173
-			throw new \SwaggerGen\Exception("Default {$type} length beyond maximum: '{$value}'");
173
+			throw new \SwaggerGen\Exception("default {$type} length beyond maximum: '{$value}'");
174 174
 		}
175 175
 
176 176
 		if ($this->minLength !== null && mb_strlen($value) < $this->minLength) {
177 177
 			$type = $this->format ?: ($this->enum ? 'enum' : 'string');
178
-			throw new \SwaggerGen\Exception("Default {$type} length beyond minimum: '{$value}'");
178
+			throw new \SwaggerGen\Exception("default {$type} length beyond minimum: '{$value}'");
179 179
 		}
180 180
 
181 181
 		return $value;
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/ObjectType.php 3 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -42,6 +42,10 @@  discard block
 block discarded – undo
42 42
 		$this->parseRange($definition, $match);
43 43
 	}
44 44
 
45
+	/**
46
+	 * @param string $definition
47
+	 * @param string[] $match
48
+	 */
45 49
 	private function parseFormat($definition, $match)
46 50
 	{
47 51
 		if (strtolower($match[1]) !== 'object') {
@@ -49,6 +53,10 @@  discard block
 block discarded – undo
49 53
 		}
50 54
 	}
51 55
 
56
+	/**
57
+	 * @param string $definition
58
+	 * @param string[] $match
59
+	 */
52 60
 	private function parseProperties($definition, $match)
53 61
 	{
54 62
 		if (!empty($match[2])) {
@@ -67,6 +75,10 @@  discard block
 block discarded – undo
67 75
 		}
68 76
 	}
69 77
 
78
+	/**
79
+	 * @param string $definition
80
+	 * @param string[] $match
81
+	 */
70 82
 	private function parseRange($definition, $match)
71 83
 	{
72 84
 		if (!empty($match[3])) {
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 					if (preg_match(self::REGEX_PROP_START . self::REGEX_PROP_NAME . self::REGEX_PROP_REQUIRED . self::REGEX_PROP_ASSIGN . self::REGEX_PROP_DEFINITION . self::REGEX_PROP_END, $property, $prop_match) !== 1) {
64 64
 						throw new \SwaggerGen\Exception("Unparseable property definition: '{$property}'");
65 65
 					}
66
-                    $this->properties[$prop_match[1]] = new Property($this, $prop_match[3]);
67
-                    if ($prop_match[2] !== '!' && $prop_match[2] !== '?') {
66
+					$this->properties[$prop_match[1]] = new Property($this, $prop_match[3]);
67
+					if ($prop_match[2] !== '!' && $prop_match[2] !== '?') {
68 68
 						$this->required[$prop_match[1]] = true;
69 69
 					}
70 70
 				}
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			// type name description...
104 104
 			case 'property':
105 105
 			case 'property?':
106
-            case 'property!':
106
+			case 'property!':
107 107
 				$definition = self::wordShift($data);
108 108
 				if (empty($definition)) {
109 109
 					throw new \SwaggerGen\Exception("Missing property definition");
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 					throw new \SwaggerGen\Exception("Missing property name: '{$definition}'");
115 115
 				}
116 116
 
117
-                unset($this->required[$name]);
117
+				unset($this->required[$name]);
118 118
 				$readOnly = null;
119
-                $propertySuffix = substr($command, -1);
120
-                if ($propertySuffix === '!') {
121
-                    $readOnly = true;
122
-                }
119
+				$propertySuffix = substr($command, -1);
120
+				if ($propertySuffix === '!') {
121
+					$readOnly = true;
122
+				}
123 123
 				else if ($propertySuffix !== '?') {
124 124
 					$this->required[$name] = true;
125 125
 				}
126 126
 
127 127
 				$this->mostRecentProperty = new Property($this, $definition, $data, $readOnly);
128
-                $this->properties[$name] = $this->mostRecentProperty;
128
+				$this->properties[$name] = $this->mostRecentProperty;
129 129
 				return $this;
130 130
 
131 131
 			case 'min':
Please login to merge, or discard this patch.
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @return \SwaggerGen\Swagger\Type\AbstractType|boolean
99 99
 	 */
100 100
 	public function handleCommand($command, $data = null)
101
-	{		
101
+	{
102 102
 		switch (strtolower($command)) {
103 103
 			// type name description...
104 104
 			case 'property':
@@ -119,8 +119,7 @@  discard block
 block discarded – undo
119 119
                 $propertySuffix = substr($command, -1);
120 120
                 if ($propertySuffix === '!') {
121 121
                     $readOnly = true;
122
-                }
123
-				else if ($propertySuffix !== '?') {
122
+                } else if ($propertySuffix !== '?') {
124 123
 					$this->required[$name] = true;
125 124
 				}
126 125
 
Please login to merge, or discard this patch.