@@ -172,7 +172,7 @@ |
||
172 | 172 | */ |
173 | 173 | protected function removeType($type) |
174 | 174 | { |
175 | - if((bool) ($this->type & $type)){ |
|
175 | + if ((bool) ($this->type & $type)) { |
|
176 | 176 | $this->type ^= $type; |
177 | 177 | } |
178 | 178 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * @param integer $modifier |
47 | 47 | */ |
48 | - public function setModifier($modifier){ |
|
48 | + public function setModifier($modifier) { |
|
49 | 49 | $this->modifier = $modifier; |
50 | 50 | } |
51 | 51 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | class CLI extends Application |
13 | 13 | { |
14 | - public function __construct($name="", $version="") |
|
14 | + public function __construct($name = "", $version = "") |
|
15 | 15 | { |
16 | 16 | parent::__construct($name, $version); |
17 | 17 | $this->initializeContainer(); |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | class UseParser { |
11 | 11 | /** @var Uses */ |
12 | 12 | private $uses; |
13 | - public function parse(Use_ $node){ |
|
14 | - foreach($node->uses AS $use){ |
|
13 | + public function parse(Use_ $node) { |
|
14 | + foreach ($node->uses AS $use) { |
|
15 | 15 | $fqcn = $this->parseFQCN($use->name->toString()); |
16 | 16 | $this->uses->add($fqcn, $use->alias); |
17 | 17 | } |
@@ -21,43 +21,43 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @param string $type |
23 | 23 | */ |
24 | - public function parseType($type){ |
|
24 | + public function parseType($type) { |
|
25 | 25 | $pureFQCN = $this->parseFQCN($type); |
26 | - if($pureFQCN->isScalar()){ |
|
26 | + if ($pureFQCN->isScalar()) { |
|
27 | 27 | return $pureFQCN; |
28 | 28 | } |
29 | - if(strpos($type, '\\') === 0){ |
|
29 | + if (strpos($type, '\\') === 0) { |
|
30 | 30 | return $pureFQCN; |
31 | 31 | } |
32 | 32 | $fqcn = $this->uses->find($type); |
33 | - if(!empty($fqcn)){ |
|
33 | + if (!empty($fqcn)) { |
|
34 | 34 | return $fqcn; |
35 | 35 | } |
36 | 36 | return $this->createFQCN($pureFQCN); |
37 | 37 | } |
38 | - public function getFQCN(Name $node = null){ |
|
39 | - if($node === null) { |
|
38 | + public function getFQCN(Name $node = null) { |
|
39 | + if ($node === null) { |
|
40 | 40 | return $node; |
41 | 41 | } |
42 | - if($node->isFullyQualified()){ |
|
42 | + if ($node->isFullyQualified()) { |
|
43 | 43 | return $this->parseFQCN($node->toString()); |
44 | 44 | } |
45 | 45 | $fqcn = $this->uses->find($node->getFirst()); |
46 | - if($fqcn){ |
|
46 | + if ($fqcn) { |
|
47 | 47 | return $fqcn; |
48 | 48 | } |
49 | 49 | return $this->createFQCN($node->toString()); |
50 | 50 | } |
51 | - public function parseFQCN($fqcn){ |
|
51 | + public function parseFQCN($fqcn) { |
|
52 | 52 | $fqcn = trim($fqcn, '\\'); |
53 | - if(empty($fqcn)){ |
|
53 | + if (empty($fqcn)) { |
|
54 | 54 | return new FQCN(''); |
55 | 55 | } |
56 | 56 | $parts = explode('\\', $fqcn); |
57 | 57 | $name = array_pop($parts); |
58 | 58 | $regex = '/(\w+)(\\[\\])?/'; |
59 | 59 | preg_match($regex, $name, $matches); |
60 | - if(count($matches) === 0){ |
|
60 | + if (count($matches) === 0) { |
|
61 | 61 | throw new \Exception("Could not parse FQCN for empty class name: " . $fqcn); |
62 | 62 | } |
63 | 63 | $name = $matches[1]; |