Completed
Pull Request — master (#23)
by
unknown
03:09
created
tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-spl_autoload_register(function ($classname) {
3
+spl_autoload_register(function($classname) {
4 4
 	$file = dirname(__DIR__) . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
5 5
 	if (is_file($file)) {
6 6
 		require_once $file;
Please login to merge, or discard this patch.
tests/Swagger/OperationTest.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@
 block discarded – undo
240 240
 	 * @covers \SwaggerGen\Swagger\Operation::handleCommand
241 241
 	 */
242 242
 	public function testHandleCommand_OperationId_UniqueInSwagger()
243
-	{	
243
+	{
244 244
 		// First occurance
245 245
 		$path = $this->parent->handleCommand('endpoint', 'foo');
246 246
 		$this->assertInstanceOf('\SwaggerGen\Swagger\Path', $path);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 			'responses' => array(
724 724
 				200 => array(
725 725
 					'description' => 'OK',
726
-					'schema' => Array(
726
+					'schema' => array(
727 727
 						'type' => 'integer',
728 728
 						'format' => 'int32',
729 729
 					),
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 			'responses' => array(
748 748
 				200 => array(
749 749
 					'description' => 'Stuff is returned',
750
-					'schema' => Array(
750
+					'schema' => array(
751 751
 						'type' => 'integer',
752 752
 						'format' => 'int32',
753 753
 					),
Please login to merge, or discard this patch.
tests/Swagger/Type/ObjectTypeTest.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -337,23 +337,23 @@
 block discarded – undo
337 337
 				. ',"tags":[{"name":"Test"}]}', json_encode($array, JSON_NUMERIC_CHECK));
338 338
 	}
339 339
 
340
-    public function testObjectPropertiesReadOnly()
341
-    {
342
-        $object = new \SwaggerGen\SwaggerGen();
343
-        $array = $object->getSwagger(array('
340
+	public function testObjectPropertiesReadOnly()
341
+	{
342
+		$object = new \SwaggerGen\SwaggerGen();
343
+		$array = $object->getSwagger(array('
344 344
 			api Test
345 345
 			endpoint /test
346 346
 			method GET something
347 347
 			response 200 object(a!:array(A),b:array(B))
348 348
 		'));
349 349
 
350
-        $this->assertSame('{"swagger":2,"info":{"title":"undefined","version":0}'
351
-            . ',"paths":{"\/test":{"get":{"tags":["Test"],"summary":"something"'
352
-            . ',"responses":{"200":{"description":"OK","schema":{"type":"object","required":["b"]'
353
-            . ',"properties":{"a":{"type":"array","items":{"$ref":"#\/definitions\/A"}}'
354
-            . ',"b":{"type":"array","items":{"$ref":"#\/definitions\/B"}}}}}}}}}'
355
-            . ',"tags":[{"name":"Test"}]}', json_encode($array, JSON_NUMERIC_CHECK));
356
-    }
350
+		$this->assertSame('{"swagger":2,"info":{"title":"undefined","version":0}'
351
+			. ',"paths":{"\/test":{"get":{"tags":["Test"],"summary":"something"'
352
+			. ',"responses":{"200":{"description":"OK","schema":{"type":"object","required":["b"]'
353
+			. ',"properties":{"a":{"type":"array","items":{"$ref":"#\/definitions\/A"}}'
354
+			. ',"b":{"type":"array","items":{"$ref":"#\/definitions\/B"}}}}}}}}}'
355
+			. ',"tags":[{"name":"Test"}]}', json_encode($array, JSON_NUMERIC_CHECK));
356
+	}
357 357
 
358 358
 	public function testDeepObjectProperties()
359 359
 	{
Please login to merge, or discard this patch.
tests/Swagger/Type/PropertyTest.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -81,20 +81,20 @@
 block discarded – undo
81 81
 				), $object->toArray());
82 82
 	}
83 83
 
84
-    /**
85
-     * @covers \SwaggerGen\Swagger\Type\PropertyType::__construct
86
-     */
87
-    public function testConstructReadOnly()
88
-    {
89
-        $object = new SwaggerGen\Swagger\Type\Property($this->parent, 'string', 'Some words here', true);
90
-        $this->assertInstanceOf('\SwaggerGen\Swagger\Type\Property', $object);
91
-
92
-        $this->assertSame(array(
93
-            'type' => 'string',
94
-            'description' => 'Some words here',
95
-            'readOnly' => true
96
-        ), $object->toArray());
97
-    }
84
+	/**
85
+	 * @covers \SwaggerGen\Swagger\Type\PropertyType::__construct
86
+	 */
87
+	public function testConstructReadOnly()
88
+	{
89
+		$object = new SwaggerGen\Swagger\Type\Property($this->parent, 'string', 'Some words here', true);
90
+		$this->assertInstanceOf('\SwaggerGen\Swagger\Type\Property', $object);
91
+
92
+		$this->assertSame(array(
93
+			'type' => 'string',
94
+			'description' => 'Some words here',
95
+			'readOnly' => true
96
+		), $object->toArray());
97
+	}
98 98
 
99 99
 	/**
100 100
 	 * @covers \SwaggerGen\Swagger\Type\PropertyType::__construct
Please login to merge, or discard this patch.
example/api/Example.class.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
  *
30 30
  * @rest\api Users Get some useful information on users
31 31
  */
32
-class Example {
32
+class Example
33
+{
33 34
 
34 35
 	private $data = array();
35 36
 
Please login to merge, or discard this patch.
tests/output/OutputTest.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,10 +30,11 @@
 block discarded – undo
30 30
 		);
31 31
 	}
32 32
 	
33
-	public function provideAllCases() {
33
+	public function provideAllCases()
34
+	{
34 35
 		$cases = array();
35 36
 		
36
-		foreach (glob(__DIR__ . '/*', GLOB_ONLYDIR) as $dir) {					
37
+		foreach (glob(__DIR__ . '/*', GLOB_ONLYDIR) as $dir) {
37 38
 			$path = realpath($dir);					
38 39
 			$json = $this->normalizeJson(file_get_contents($path . '/expected.json'));
39 40
 			
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Swagger.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 				return $this;
143 143
 
144 144
 			case 'model':
145
-            case 'model!':
145
+			case 'model!':
146 146
 			case 'definition':
147
-            case 'definition!':
147
+			case 'definition!':
148 148
 				$name = self::wordShift($data);
149 149
 				if (empty($name)) {
150 150
 					throw new \SwaggerGen\Exception('Missing definition name');
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 
157 157
 				$definition = new Schema($this, $typeDef);
158 158
 				if(substr($command, -1) === '!') {
159
-				    $definition->setReadOnly();
160
-                }
159
+					$definition->setReadOnly();
160
+				}
161 161
 				$this->definitions[$name] = $definition;
162 162
 				return $definition;
163 163
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
 				}
156 156
 
157 157
 				$definition = new Schema($this, $typeDef);
158
-				if(substr($command, -1) === '!') {
158
+				if (substr($command, -1) === '!') {
159 159
 				    $definition->setReadOnly();
160 160
                 }
161 161
 				$this->definitions[$name] = $definition;
Please login to merge, or discard this patch.
SwaggerGen/Swagger/Type/AbstractType.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
 		// Internal type if type known and not overwritten by definition
121 121
 		if (isset(self::$classTypes[$format])) {
122 122
 			$type = self::$classTypes[$format];
123
-			$class = "SwaggerGen\\Swagger\\Type\\{$type}Type";
123
+			$class = "SwaggerGen\\Swagger\\Type\\{$type}type";
124 124
 			return new $class($parent, $definition);
125 125
 		} else {
126 126
 			return new ReferenceObjectType($parent, $definition);
Please login to merge, or discard this patch.