@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Creator: adamgrabek |
|
4 | - * Date: 13.01.2016 |
|
5 | - * Time: 15:06 |
|
6 | - */ |
|
3 | + * Creator: adamgrabek |
|
4 | + * Date: 13.01.2016 |
|
5 | + * Time: 15:06 |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace CodeMine\ConfluenceImporter\Service\Confluence; |
9 | 9 |
@@ -74,6 +74,9 @@ discard block |
||
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | + /** |
|
78 | + * @param string $key |
|
79 | + */ |
|
77 | 80 | public function getPageId($key, PageInterface $page) //TODO::Change for private method |
78 | 81 | { |
79 | 82 | $headers = [ |
@@ -178,7 +181,7 @@ discard block |
||
178 | 181 | |
179 | 182 | /** |
180 | 183 | * @param $headers |
181 | - * @param $body |
|
184 | + * @param string $body |
|
182 | 185 | * @return Request |
183 | 186 | */ |
184 | 187 | private function getRequest($headers, $body) |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $stdBody = json_decode($returnBody->getContents()); |
102 | 102 | if ($response->getStatusCode() == 200 && count($stdBody->results) == 1) { |
103 | - $id = (string)$stdBody->results[0]->id; |
|
103 | + $id = (string) $stdBody->results[0]->id; |
|
104 | 104 | |
105 | 105 | return $id; |
106 | 106 | |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | ]; |
160 | 160 | |
161 | 161 | if (isset($parentPage)) { |
162 | - if (isset($id)){ |
|
162 | + if (isset($id)) { |
|
163 | 163 | $bodyArray['ancestors'] = [ |
164 | 164 | ['id' => $id] |
165 | 165 | ]; |
166 | - }else { |
|
166 | + } else { |
|
167 | 167 | $pageId = $this->getPageId($key, $parentPage); |
168 | 168 | $bodyArray['ancestors'] = [ |
169 | 169 | ['id' => $pageId] |
@@ -163,7 +163,7 @@ |
||
163 | 163 | $bodyArray['ancestors'] = [ |
164 | 164 | ['id' => $id] |
165 | 165 | ]; |
166 | - }else { |
|
166 | + } else { |
|
167 | 167 | $pageId = $this->getPageId($key, $parentPage); |
168 | 168 | $bodyArray['ancestors'] = [ |
169 | 169 | ['id' => $pageId] |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by IntelliJ IDEA. |
|
4 | - * User: yoshi |
|
5 | - * Date: 27.01.16 |
|
6 | - * Time: 19:52 |
|
7 | - */ |
|
3 | + * Created by IntelliJ IDEA. |
|
4 | + * User: yoshi |
|
5 | + * Date: 27.01.16 |
|
6 | + * Time: 19:52 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace CodeMine\ConfluenceImporter\Parser\File; |
10 | 10 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by IntelliJ IDEA. |
|
4 | - * User: yoshi |
|
5 | - * Date: 29.01.16 |
|
6 | - * Time: 15:37 |
|
7 | - */ |
|
3 | + * Created by IntelliJ IDEA. |
|
4 | + * User: yoshi |
|
5 | + * Date: 29.01.16 |
|
6 | + * Time: 15:37 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace CodeMine\ConfluenceImporter\Parser\Structure\Attribute; |
10 | 10 |
@@ -48,19 +48,19 @@ discard block |
||
48 | 48 | { |
49 | 49 | $fileCollection = new \SplObjectStorage(); |
50 | 50 | |
51 | - foreach ($this->classArray as $class){ |
|
51 | + foreach ($this->classArray as $class) { |
|
52 | 52 | |
53 | 53 | $file = new File(); |
54 | 54 | |
55 | - if (isset($class['@attributes'])){ |
|
55 | + if (isset($class['@attributes'])) { |
|
56 | 56 | $path = $class['@attributes']['path']; |
57 | 57 | $package = $class['@attributes']['package']; |
58 | 58 | $file->setPath($path); |
59 | 59 | $file->setPackage($package); |
60 | 60 | } |
61 | 61 | |
62 | - foreach ($class as $key => $value){ |
|
63 | - switch($key){ |
|
62 | + foreach ($class as $key => $value) { |
|
63 | + switch ($key) { |
|
64 | 64 | case 'class': |
65 | 65 | $file->setType($key); |
66 | 66 | $file->setAbstract(strtolower($class['class']['@attributes']['abstract']) === 'true'); |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | |
79 | 79 | } |
80 | 80 | |
81 | - if (isset($class['namespace-alias'])){ |
|
81 | + if (isset($class['namespace-alias'])) { |
|
82 | 82 | $file->setNamespaceAlias($class['namespace-alias']); |
83 | 83 | } |
84 | 84 | |
85 | 85 | // var_dump($class);die; |
86 | 86 | // var_dump((isset($class['constant']))); |
87 | - if (isset($class['class']['constant'])){ |
|
87 | + if (isset($class['class']['constant'])) { |
|
88 | 88 | $constant = new Constant(); |
89 | 89 | $name = $class['class']['constant']['name']; |
90 | 90 | $fullName = $class['class']['constant']['full_name']; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $file->setConstant($constant); |
98 | 98 | } |
99 | 99 | |
100 | - if (isset($class['class']['property'])){ |
|
100 | + if (isset($class['class']['property'])) { |
|
101 | 101 | $test = $class['class']['property']; |
102 | 102 | $this->setProperty($class['class']['property'], $file); |
103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | case 'interface': |
109 | 109 | $file->setType($key); |
110 | 110 | $file->setNamespace($class['interface']['@attributes']['namespace']); |
111 | - if (isset($class['namespace-alias'])){ |
|
111 | + if (isset($class['namespace-alias'])) { |
|
112 | 112 | $file->setNamespaceAlias($class['namespace-alias']); |
113 | 113 | } |
114 | 114 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | break; |
117 | 117 | case 'trait': |
118 | 118 | $file->setType($key); |
119 | - if (isset($class['namespace-alias'])){ |
|
119 | + if (isset($class['namespace-alias'])) { |
|
120 | 120 | $file->setNamespaceAlias($class['namespace-alias']); |
121 | 121 | } |
122 | 122 | echo $key . PHP_EOL; |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | // print_r($property); |
179 | 179 | $zal = array_key_exists('name', $property); |
180 | 180 | $zalozenie = (FALSE === array_key_exists('name', $property)); |
181 | - if(FALSE === array_key_exists('name', $property)){ |
|
182 | - foreach ($property as $prop){ |
|
181 | + if (FALSE === array_key_exists('name', $property)) { |
|
182 | + foreach ($property as $prop) { |
|
183 | 183 | $this->setProperty($prop, $file); |
184 | 184 | } |
185 | 185 | return; |
@@ -9,4 +9,4 @@ |
||
9 | 9 | namespace CodeMine\ConfluenceImporter\Parser\Structure\Attribute\Collection; |
10 | 10 | |
11 | 11 | |
12 | -class Properties extends \SplObjectStorage{} |
|
13 | 12 | \ No newline at end of file |
13 | +class Properties extends \SplObjectStorage {} |
|
14 | 14 | \ No newline at end of file |