Completed
Pull Request — master (#67)
by
unknown
13:16
created
src/model/AbstractPhpStruct.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 		return new static($name);
58 58
 	}
59 59
 
60
-    public static function fromName(string $name): self
61
-    {
62
-        $ref = new \ReflectionClass($name);
60
+	public static function fromName(string $name): self
61
+	{
62
+		$ref = new \ReflectionClass($name);
63 63
 
64
-        return static::fromFile($ref->getFileName());
65
-    }
64
+		return static::fromFile($ref->getFileName());
65
+	}
66 66
 
67 67
 	/**
68 68
 	 * Creates a new struct
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
 	 * @return $this
136 136
 	 */
137 137
 	public function addUseStatement($qualifiedName, string $alias = null) {
138
-        if ($qualifiedName instanceof PhpTypeInterface) {
139
-            $qualifiedName = $qualifiedName->getQualifiedName();
140
-        }
138
+		if ($qualifiedName instanceof PhpTypeInterface) {
139
+			$qualifiedName = $qualifiedName->getQualifiedName();
140
+		}
141 141
 
142
-        if (TypeUtils::isGlobalQualifiedName($qualifiedName) || TypeUtils::isNativeType($qualifiedName)) {
143
-            return $this;
144
-        }
142
+		if (TypeUtils::isGlobalQualifiedName($qualifiedName) || TypeUtils::isNativeType($qualifiedName)) {
143
+			return $this;
144
+		}
145 145
 
146
-	    if ($qualifiedName === $this->getNamespace()) {
147
-	        return $this;
148
-        }
146
+		if ($qualifiedName === $this->getNamespace()) {
147
+			return $this;
148
+		}
149 149
 		if (!is_string($alias)) {
150 150
 			if (false === strpos($qualifiedName, '\\')) {
151 151
 				$alias = $qualifiedName;
@@ -271,24 +271,24 @@  discard block
 block discarded – undo
271 271
 		$method->setParent($this);
272 272
 		$this->methods->set($method->getName(), $method);
273 273
 		$types = $method->getTypes();
274
-        if ($types) {
275
-            foreach ($types as $type) {
276
-                $this->addUseStatement($type);
277
-                $method->addType($type);
278
-            }
279
-        }
280
-
281
-        foreach ($method->getParameters() as $parameter) {
282
-            $types = $parameter->getTypes();
283
-            if ($types) {
284
-                foreach ($types as $type) {
285
-                    $this->addUseStatement($type);
286
-                    $parameter->addType($type);
287
-                }
288
-            }
289
-        }
290
-
291
-        return $this;
274
+		if ($types) {
275
+			foreach ($types as $type) {
276
+				$this->addUseStatement($type);
277
+				$method->addType($type);
278
+			}
279
+		}
280
+
281
+		foreach ($method->getParameters() as $parameter) {
282
+			$types = $parameter->getTypes();
283
+			if ($types) {
284
+				foreach ($types as $type) {
285
+					$this->addUseStatement($type);
286
+					$parameter->addType($type);
287
+				}
288
+			}
289
+		}
290
+
291
+		return $this;
292 292
 	}
293 293
 
294 294
 	/**
Please login to merge, or discard this patch.
src/model/PhpFunction.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,8 +93,8 @@
 block discarded – undo
93 93
 		$this->setQualifiedName($name);
94 94
 		$this->docblock = new Docblock();
95 95
 		$this->initParameters();
96
-        $this->initTypes();
97
-    }
96
+		$this->initTypes();
97
+	}
98 98
 
99 99
 	/**
100 100
 	 * @inheritDoc
Please login to merge, or discard this patch.
src/model/AbstractModel.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
 			$description = implode("\n", $description);
34 34
 		}
35 35
 		if ($description) {
36
-            $this->description = $description;
37
-        }
36
+			$this->description = $description;
37
+		}
38 38
 		return $this;
39 39
 	}
40 40
 
Please login to merge, or discard this patch.
src/model/PhpParameter.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function __construct($name = null) {
57 57
 		$this->setName($name);
58
-        $this->initTypes();
59
-    }
58
+		$this->initTypes();
59
+	}
60 60
 
61 61
 	/**
62 62
 	 * Sets whether this parameter is passed by reference
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 	 * @return ParamTag
86 86
 	 */
87 87
 	public function getDocblockTag(): ParamTag {
88
-        $type = '';
89
-        if ($this->getNullable()) {
90
-            $type = 'null';
91
-        }
92
-        if ($this->getTypes()) {
93
-            if ($type) {
94
-                $type .= '|';
95
-            }
96
-            $type .= TypeUtils::typesToExpression($this->getTypes());
97
-        }
88
+		$type = '';
89
+		if ($this->getNullable()) {
90
+			$type = 'null';
91
+		}
92
+		if ($this->getTypes()) {
93
+			if ($type) {
94
+				$type .= '|';
95
+			}
96
+			$type .= TypeUtils::typesToExpression($this->getTypes());
97
+		}
98 98
 		return ParamTag::create()
99 99
 			->setType($type)
100 100
 			->setVariable($this->getName())
Please login to merge, or discard this patch.
src/model/PhpType.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class PhpType implements PhpTypeInterface
8 8
 {
9
-    use QualifiedNamePart;
9
+	use QualifiedNamePart;
10 10
 
11
-    public function __construct($qualifiedName)
12
-    {
13
-        $this->setQualifiedName($qualifiedName);
14
-    }
11
+	public function __construct($qualifiedName)
12
+	{
13
+		$this->setQualifiedName($qualifiedName);
14
+	}
15 15
 
16
-    public function __toString(): string
17
-    {
18
-        return $this->getQualifiedName();
19
-    }
16
+	public function __toString(): string
17
+	{
18
+		return $this->getQualifiedName();
19
+	}
20 20
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,12 +4,10 @@
 block discarded – undo
4 4
 
5 5
 use gossi\codegen\model\parts\QualifiedNamePart;
6 6
 
7
-class PhpType implements PhpTypeInterface
8
-{
7
+class PhpType implements PhpTypeInterface {
9 8
     use QualifiedNamePart;
10 9
 
11
-    public function __construct($qualifiedName)
12
-    {
10
+    public function __construct($qualifiedName) {
13 11
         $this->setQualifiedName($qualifiedName);
14 12
     }
15 13
 
Please login to merge, or discard this patch.
src/model/parts/PropertiesPart.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,12 +53,12 @@
 block discarded – undo
53 53
 		$property->setParent($this);
54 54
 		$types = $property->getTypes();
55 55
 
56
-        if ($types) {
57
-            foreach ($types as $type) {
58
-                $this->addUseStatement($type);
59
-                $property->addType($type);
60
-            }
61
-        }
56
+		if ($types) {
57
+			foreach ($types as $type) {
58
+				$this->addUseStatement($type);
59
+				$property->addType($type);
60
+			}
61
+		}
62 62
 
63 63
 		$this->properties->set($property->getName(), $property);
64 64
 
Please login to merge, or discard this patch.
src/model/parts/ParametersPart.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return $this
80 80
 	 */
81 81
 	public function addSimpleParameter(string $name, $types = null, $defaultValue = null) {
82
-	    $types = (array)$types;
82
+		$types = (array)$types;
83 83
 		$parameter = new PhpParameter($name);
84 84
 		$parameter->setTypes($types);
85 85
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function addSimpleDescParameter(string $name, $types = null, string $typeDescription = null, $defaultValue = null) {
105 105
 		$types = (array)$types;
106
-	    $parameter = new PhpParameter($name);
106
+		$parameter = new PhpParameter($name);
107 107
 		$parameter->setTypes($types);
108 108
 		$parameter->setTypeDescription($typeDescription);
109 109
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 		$docblock = $this->getDocblock();
219 219
 		$tags = $docblock->getTags('param');
220 220
 		foreach ($this->parameters as $param) {
221
-		    if (!empty($noTypeHint[$param->getName()])) {
222
-                continue;
223
-            }
221
+			if (!empty($noTypeHint[$param->getName()])) {
222
+				continue;
223
+			}
224 224
 			$ptag = $param->getDocblockTag();
225 225
 
226 226
 			$tag = $tags->find($ptag, function (ParamTag $tag, ParamTag $ptag) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return $this
80 80
 	 */
81 81
 	public function addSimpleParameter(string $name, $types = null, $defaultValue = null) {
82
-	    $types = (array)$types;
82
+	    $types = (array) $types;
83 83
 		$parameter = new PhpParameter($name);
84 84
 		$parameter->setTypes($types);
85 85
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @return $this
103 103
 	 */
104 104
 	public function addSimpleDescParameter(string $name, $types = null, string $typeDescription = null, $defaultValue = null) {
105
-		$types = (array)$types;
105
+		$types = (array) $types;
106 106
 	    $parameter = new PhpParameter($name);
107 107
 		$parameter->setTypes($types);
108 108
 		$parameter->setTypeDescription($typeDescription);
Please login to merge, or discard this patch.
src/model/parts/InterfacesPart.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,19 +78,19 @@
 block discarded – undo
78 78
 		return $this->interfaces;
79 79
 	}
80 80
 
81
-    /**
82
-     * @return iterable|PhpInterface[]
83
-     */
84
-    public function getPhpInterfaces(): iterable
85
-    {
86
-        $interfaces = [];
87
-        foreach ($this->interfaces as $interface) {
88
-            $interfaces[] = interface_exists($interface) ?
89
-                PhpInterface::fromName($interface) : PhpInterface::create($interface);
90
-        }
91
-
92
-        return $interfaces;
93
-    }
81
+	/**
82
+	 * @return iterable|PhpInterface[]
83
+	 */
84
+	public function getPhpInterfaces(): iterable
85
+	{
86
+		$interfaces = [];
87
+		foreach ($this->interfaces as $interface) {
88
+			$interfaces[] = interface_exists($interface) ?
89
+				PhpInterface::fromName($interface) : PhpInterface::create($interface);
90
+		}
91
+
92
+		return $interfaces;
93
+	}
94 94
 
95 95
 	/**
96 96
 	 * Checks whether interfaces exists
Please login to merge, or discard this patch.
src/model/parts/TraitsPart.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -75,18 +75,18 @@
 block discarded – undo
75 75
 		return $this->traits;
76 76
 	}
77 77
 
78
-    /**
79
-     * @return iterable|PhpTrait[]
80
-     */
81
-    public function getPhpTraits(): iterable {
82
-        $traits = [];
83
-        foreach ($this->traits as $trait) {
84
-            $traits[] = trait_exists($trait) ?
85
-                PhpTrait::fromName($trait) : PhpTrait::create($trait);
86
-        }
87
-
88
-        return $traits;
89
-    }
78
+	/**
79
+	 * @return iterable|PhpTrait[]
80
+	 */
81
+	public function getPhpTraits(): iterable {
82
+		$traits = [];
83
+		foreach ($this->traits as $trait) {
84
+			$traits[] = trait_exists($trait) ?
85
+				PhpTrait::fromName($trait) : PhpTrait::create($trait);
86
+		}
87
+
88
+		return $traits;
89
+	}
90 90
 
91 91
 	/**
92 92
 	 * Checks whether a trait exists
Please login to merge, or discard this patch.