Completed
Push — master ( 6bbcad...f165ab )
by Thomas
04:20
created
src/utils/GeneratorUtils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
 	public static function callMethod(\ReflectionMethod $method, array $params = null) {
31 31
 		if (null === $params) {
32
-			$params = array_map(function ($p) {
32
+			$params = array_map(function($p) {
33 33
 				return '$' . $p->name;
34 34
 			}, $method->getParameters());
35 35
 		}
Please login to merge, or discard this patch.
src/utils/ReflectionUtils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			$filter |= \ReflectionMethod::IS_PROTECTED;
33 33
 		}
34 34
 		
35
-		return array_filter($class->getMethods($filter), function ($method) {
35
+		return array_filter($class->getMethods($filter), function($method) {
36 36
 			return !$method->isFinal() && !$method->isStatic();
37 37
 		});
38 38
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		}
82 82
 		$tokenizer = new PhpTokenizer();
83 83
 		$tokens = $tokenizer->tokenize($content);
84
-		$tokens = $tokens->filter(function ($token) {
84
+		$tokens = $tokens->filter(function($token) {
85 85
 			return $token->type !== T_WHITESPACE && $token->type !== T_COMMENT && $token->type !== T_DOC_COMMENT;
86 86
 		});
87 87
 		$statements = [];
Please login to merge, or discard this patch.
src/model/AbstractPhpStruct.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -131,11 +131,11 @@
 block discarded – undo
131 131
 	 * 
132 132
 	 * If the class has already been declared you get only the set alias.
133 133
 	 * 
134
- 	 * @param string      $fullClassName
135
- 	 * @param null|string $alias
136
- 	 *
137
- 	 * @return string
138
- 	 */
134
+	 * @param string      $fullClassName
135
+	 * @param null|string $alias
136
+	 *
137
+	 * @return string
138
+	 */
139 139
  	public function declareUse($fullClassName, $alias = null)
140 140
 	{
141 141
  		$fullClassName = trim($fullClassName, '\\');
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@  discard block
 block discarded – undo
117 117
 	/**
118 118
 	 *  Declares multiple use statements at once.
119 119
 	 */
120
-	public function declareUses()
121
- 	{
120
+	public function declareUses() {
122 121
  		foreach (func_get_args() as $name) {
123 122
  			$this->declareUse($name);
124 123
  		}
@@ -136,8 +135,7 @@  discard block
 block discarded – undo
136 135
  	 *
137 136
  	 * @return string
138 137
  	 */
139
- 	public function declareUse($fullClassName, $alias = null)
140
-	{
138
+ 	public function declareUse($fullClassName, $alias = null) {
141 139
  		$fullClassName = trim($fullClassName, '\\');
142 140
  		if (!$this->hasUseStatement($fullClassName)) {
143 141
  			$this->addUseStatement($fullClassName, $alias);
Please login to merge, or discard this patch.
src/model/PhpParameter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 	 * @return ParamTag
86 86
 	 */
87 87
 	public function getDocblockTag() {
88
-		return ParamTag::create()->setType($this->getType() ?  : 'mixed')->setVariable($this->getName())->setDescription($this->getTypeDescription());
88
+		return ParamTag::create()->setType($this->getType() ?: 'mixed')->setVariable($this->getName())->setDescription($this->getTypeDescription());
89 89
 	}
90 90
 
91 91
 	/**
Please login to merge, or discard this patch.
src/model/parts/ConstantsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
 			return $this->constants;
93 93
 		}
94 94
 		
95
-		return array_map(function (PhpConstant $constant) {
95
+		return array_map(function(PhpConstant $constant) {
96 96
 			return $constant->getValue();
97 97
 		}, $this->constants);
98 98
 	}
Please login to merge, or discard this patch.
src/visitor/DefaultNavigator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	private function getConstantSortFunc() {
146
-		return $this->constantSortFunc ?  : 'strcasecmp';
146
+		return $this->constantSortFunc ?: 'strcasecmp';
147 147
 	}
148 148
 
149 149
 	private function getMethodSortFunc() {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 		}
153 153
 		
154 154
 		if (empty(self::$defaultMethodSortFunc)) {
155
-			self::$defaultMethodSortFunc = function ($a, $b) {
155
+			self::$defaultMethodSortFunc = function($a, $b) {
156 156
 				if ($a->isStatic() !== $isStatic = $b->isStatic()) {
157 157
 					return $isStatic ? 1 : -1;
158 158
 				}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		}
178 178
 		
179 179
 		if (empty(self::$defaultPropertySortFunc)) {
180
-			self::$defaultPropertySortFunc = function ($a, $b) {
180
+			self::$defaultPropertySortFunc = function($a, $b) {
181 181
 				if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) {
182 182
 					$aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1);
183 183
 					$bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1);
Please login to merge, or discard this patch.
src/visitor/DefaultVisitor.php 3 patches
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -343,14 +343,14 @@
 block discarded – undo
343 343
 				$defaultValue = $parameter->getDefaultValue();
344 344
 
345 345
 				switch (true) {
346
-					case is_array($defaultValue) && empty($defaultValue):
347
-						$this->writer->write('array()');
348
-						break;
349
-					case ($defaultValue instanceof PhpConstant):
350
-						$this->writer->write($defaultValue->getName());
351
-						break;
352
-					default:
353
-					$this->writer->write($this->getPhpExport($defaultValue));
346
+				case is_array($defaultValue) && empty($defaultValue):
347
+					$this->writer->write('array()');
348
+					break;
349
+				case ($defaultValue instanceof PhpConstant):
350
+					$this->writer->write($defaultValue->getName());
351
+					break;
352
+				default:
353
+				$this->writer->write($this->getPhpExport($defaultValue));
354 354
 
355 355
 				}
356 356
 			}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
 	public function __construct(CodeGeneratorConfig $config = null) {
62 62
 		// Make sure we retain the old default behavior for this class
63
-		$this->config = $config?: new CodeGeneratorConfig(['generateEmptyDocblock' => false]);
63
+		$this->config = $config ?: new CodeGeneratorConfig(['generateEmptyDocblock' => false]);
64 64
 		$this->writer = new Writer();
65 65
 	}
66 66
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@
 block discarded – undo
358 358
 	}
359 359
 
360 360
 	protected function writeFunctionReturnType($type) {
361
-		if ($this->config->getGenerateReturnTypeHints() && $type != NULL && false === strpos($type, '|')) {
361
+		if ($this->config->getGenerateReturnTypeHints() && $type != null && false === strpos($type, '|')) {
362 362
 			$this->writer->write(': ')->write($type);
363 363
 		}
364 364
 	}
Please login to merge, or discard this patch.
src/parser/visitor/AbstractPhpStructVisitor.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 use PhpParser\Node\Stmt\Property;
20 20
 use PhpParser\Node\Stmt\TraitUse;
21 21
 use PhpParser\Node\Stmt\UseUse;
22
-use PhpParser\NodeTraverser;
23 22
 use PhpParser\NodeVisitorAbstract;
24 23
 use PhpParser\PrettyPrinter\Standard;
25 24
 use PhpParser\Node\Stmt\Class_;
Please login to merge, or discard this patch.
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -48,44 +48,44 @@
 block discarded – undo
48 48
 	
49 49
 	public function enterNode(Node $node) {
50 50
 		switch ($node->getType()) {
51
-			case 'Stmt_Namespace':
52
-				$this->visitNamespace($node);
53
-				break;
51
+		case 'Stmt_Namespace':
52
+			$this->visitNamespace($node);
53
+			break;
54 54
 				
55
-			case 'Stmt_UseUse':
56
-				$this->visitUseStatement($node);
57
-				break;
55
+		case 'Stmt_UseUse':
56
+			$this->visitUseStatement($node);
57
+			break;
58 58
 				
59
-			case 'Stmt_Class':
60
-				$this->visitStruct($node);
61
-				$this->visitClass($node);
62
-				break;
59
+		case 'Stmt_Class':
60
+			$this->visitStruct($node);
61
+			$this->visitClass($node);
62
+			break;
63 63
 				
64
-			case 'Stmt_Interface':
65
-				$this->visitStruct($node);
66
-				$this->visitInterface($node);
67
-				break;
64
+		case 'Stmt_Interface':
65
+			$this->visitStruct($node);
66
+			$this->visitInterface($node);
67
+			break;
68 68
 				
69
-			case 'Stmt_Trait':
70
-				$this->visitStruct($node);
71
-				$this->visitTrait($node);
72
-				break;
69
+		case 'Stmt_Trait':
70
+			$this->visitStruct($node);
71
+			$this->visitTrait($node);
72
+			break;
73 73
 				
74
-			case 'Stmt_TraitUse':
75
-				$this->visitTraitUse($node);
76
-				break;
74
+		case 'Stmt_TraitUse':
75
+			$this->visitTraitUse($node);
76
+			break;
77 77
 				
78
-			case 'Const':
79
-				$this->visitConstant($node);
80
-				break;
78
+		case 'Const':
79
+			$this->visitConstant($node);
80
+			break;
81 81
 				
82
-			case 'Stmt_Property':
83
-				$this->visitProperty($node);
84
-				break;
82
+		case 'Stmt_Property':
83
+			$this->visitProperty($node);
84
+			break;
85 85
 				
86
-			case 'Stmt_ClassMethod':
87
-				$this->visitMethod($node);
88
-				break;
86
+		case 'Stmt_ClassMethod':
87
+			$this->visitMethod($node);
88
+			break;
89 89
 		}
90 90
 // 		echo $node->getType() . "\n";
91 91
 		
Please login to merge, or discard this patch.