Completed
Branch master (7d16f2)
by Jörg
02:15
created
Classes/Domrobot.php 4 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -81,6 +81,10 @@  discard block
 block discarded – undo
81 81
         }
82 82
     }
83 83
 
84
+    /**
85
+     * @param string $object
86
+     * @param string $method
87
+     */
84 88
     public function call($object, $method, array $params = array())
85 89
     {
86 90
         if (isset($this->customer) && $this->customer != "") {
@@ -203,6 +207,9 @@  discard block
 block discarded – undo
203 207
         return $this->language;
204 208
     }
205 209
 
210
+    /**
211
+     * @param string $language
212
+     */
206 213
     public function setLanguage($language)
207 214
     {
208 215
         $this->language = $language;
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: joerg
5
- * Date: 14.02.16
6
- * Time: 20:31
7
- * copied and modified from https://github.com/inwx/php-client
8
- */
3
+     * Created by PhpStorm.
4
+     * User: joerg
5
+     * Date: 14.02.16
6
+     * Time: 20:31
7
+     * copied and modified from https://github.com/inwx/php-client
8
+     */
9 9
 namespace Bingemer\InwxBundle\Classes;
10 10
 
11 11
 class Domrobot
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     private $clTRID = null;
18 18
 
19 19
     private $_ver = "2.4";
20
-	private $_cachedir;
20
+    private $_cachedir;
21 21
     private $_cookiefile = NULL;
22 22
 
23 23
     function __construct($address, $locale = 'en', $cache_dir, $username, $password, $sharedSecret = null)
@@ -29,32 +29,32 @@  discard block
 block discarded – undo
29 29
         $this->loginResult = $this->login($username, $password, $sharedSecret);
30 30
     }
31 31
 
32
-	public function createRecord($name, $ip, $domain = 'somedomainnameyouwishtoupgrade.de', $type = 'A')
33
-	{
34
-		if (strpos($name, $domain) === false) {
35
-			$name = $name.".".$domain;
36
-		}
37
-		try {
38
-			$result = $this->call('nameserver', 'createRecord', array(
39
-				'domain' => $domain,
40
-				'type' => $type,
41
-				'name' => $name,
42
-				'content' => $ip
43
-			));
44
-			return $result;
45
-		} catch (Exception $e) {
46
-			return $e->getMessage();
47
-		}
48
-	}
49
-
50
-	public function updateRecord($id, $ip)
51
-	{
32
+    public function createRecord($name, $ip, $domain = 'somedomainnameyouwishtoupgrade.de', $type = 'A')
33
+    {
34
+        if (strpos($name, $domain) === false) {
35
+            $name = $name.".".$domain;
36
+        }
37
+        try {
38
+            $result = $this->call('nameserver', 'createRecord', array(
39
+                'domain' => $domain,
40
+                'type' => $type,
41
+                'name' => $name,
42
+                'content' => $ip
43
+            ));
44
+            return $result;
45
+        } catch (Exception $e) {
46
+            return $e->getMessage();
47
+        }
48
+    }
49
+
50
+    public function updateRecord($id, $ip)
51
+    {
52 52
         $result = $this->call('nameserver','updateRecord', array(
53 53
             'id' => $id,
54 54
             'content' => $ip
55 55
         ));
56
-		return $result;
57
-	}
56
+        return $result;
57
+    }
58 58
 
59 59
     public function login($username, $password, $sharedSecret = null)
60 60
     {
Please login to merge, or discard this 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
 	public function createRecord($name, $ip, $domain = 'somedomainnameyouwishtoupgrade.de', $type = 'A')
33 33
 	{
34 34
 		if (strpos($name, $domain) === false) {
35
-			$name = $name.".".$domain;
35
+			$name = $name . "." . $domain;
36 36
 		}
37 37
 		try {
38 38
 			$result = $this->call('nameserver', 'createRecord', array(
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 	public function updateRecord($id, $ip)
51 51
 	{
52
-        $result = $this->call('nameserver','updateRecord', array(
52
+        $result = $this->call('nameserver', 'updateRecord', array(
53 53
             'id' => $id,
54 54
             'content' => $ip
55 55
         ));
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,25 +143,33 @@
 block discarded – undo
143 143
 
144 144
     private function _base32Decode($secret)
145 145
     {
146
-        if (empty($secret)) return '';
146
+        if (empty($secret)) {
147
+            return '';
148
+        }
147 149
 
148 150
         $base32chars = $this->_getBase32LookupTable();
149 151
         $base32charsFlipped = array_flip($base32chars);
150 152
 
151 153
         $paddingCharCount = substr_count($secret, $base32chars[32]);
152 154
         $allowedValues = array(6, 4, 3, 1, 0);
153
-        if (!in_array($paddingCharCount, $allowedValues)) return false;
155
+        if (!in_array($paddingCharCount, $allowedValues)) {
156
+            return false;
157
+        }
154 158
         for ($i = 0; $i < 4; $i++) {
155 159
             if ($paddingCharCount == $allowedValues[$i] &&
156 160
                 substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])
157
-            ) return false;
161
+            ) {
162
+                return false;
163
+            }
158 164
         }
159 165
         $secret = str_replace('=', '', $secret);
160 166
         $secret = str_split($secret);
161 167
         $binaryString = "";
162 168
         for ($i = 0; $i < count($secret); $i = $i + 8) {
163 169
             $x = "";
164
-            if (!in_array($secret[$i], $base32chars)) return false;
170
+            if (!in_array($secret[$i], $base32chars)) {
171
+                return false;
172
+            }
165 173
             for ($j = 0; $j < 8; $j++) {
166 174
                 $x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
167 175
             }
Please login to merge, or discard this patch.
DependencyInjection/BingemerInwxExtension.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: joerg
5
- * Date: 14.02.16
6
- * Time: 19:38
7
- */
3
+     * Created by PhpStorm.
4
+     * User: joerg
5
+     * Date: 14.02.16
6
+     * Time: 19:38
7
+     */
8 8
 namespace Bingemer\InwxBundle\DependencyInjection;
9 9
 
10 10
 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         //service
23 23
         $loader = new YamlFileLoader(
24 24
             $container,
25
-            new FileLocator(__DIR__.'/../Resources/config')
25
+            new FileLocator(__DIR__ . '/../Resources/config')
26 26
         );
27 27
         $loader->load('services.yml');
28 28
     }
Please login to merge, or discard this patch.
DependencyInjection/Configuration.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: joerg
5
- * Date: 14.02.16
6
- * Time: 19:47
7
- */
3
+     * Created by PhpStorm.
4
+     * User: joerg
5
+     * Date: 14.02.16
6
+     * Time: 19:47
7
+     */
8 8
 namespace Bingemer\InwxBundle\DependencyInjection;
9 9
 
10 10
 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Please login to merge, or discard this patch.