Completed
Pull Request — master (#5)
by Sam
02:48
created
lib/ResourceRecord.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     }
84 84
 
85 85
     /**
86
-     * @param $name
86
+     * @param string $name
87 87
      *
88 88
      * @throws DNSException
89 89
      */
Please login to merge, or discard this patch.
lib/AlignedBuilder.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     public function build(ZoneInterface $zone)
50 50
     {
51 51
         $master = '$ORIGIN '.$zone->getName().PHP_EOL.
52
-                  '$TTL '.$zone->getDefaultTtl().PHP_EOL;
52
+                    '$TTL '.$zone->getDefaultTtl().PHP_EOL;
53 53
 
54 54
         $rrs = $zone->getResourceRecords();
55 55
         $current = SoaRdata::TYPE;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function build(ZoneInterface $zone)
50 50
     {
51
-        $master = '$ORIGIN '.$zone->getName().PHP_EOL.
52
-                  '$TTL '.$zone->getDefaultTtl().PHP_EOL;
51
+        $master = '$ORIGIN ' . $zone->getName() . PHP_EOL .
52
+                  '$TTL ' . $zone->getDefaultTtl() . PHP_EOL;
53 53
 
54 54
         $rrs = $zone->getResourceRecords();
55 55
         $current = SoaRdata::TYPE;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         foreach ($rrs as $rr) {
60 60
             /* @var $rr ResourceRecord */
61 61
             $namePadding = (strlen($rr->getName()) > $namePadding) ? strlen($rr->getName()) : $namePadding;
62
-            $ttlPadding = (strlen($rr->getTtl()) > $ttlPadding)   ? strlen($rr->getTtl())  : $ttlPadding;
62
+            $ttlPadding = (strlen($rr->getTtl()) > $ttlPadding) ? strlen($rr->getTtl()) : $ttlPadding;
63 63
             $typePadding = (strlen($rr->getType()) > $typePadding) ? strlen($rr->getType()) : $typePadding;
64 64
         }
65 65
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             }
71 71
 
72 72
             if ($rr->getType() !== $current) {
73
-                $master .= PHP_EOL.ResourceRecord::COMMENT_DELIMINATOR.$rr->getType().' RECORDS'.PHP_EOL;
73
+                $master .= PHP_EOL . ResourceRecord::COMMENT_DELIMINATOR . $rr->getType() . ' RECORDS' . PHP_EOL;
74 74
                 $current = $rr->getType();
75 75
             }
76 76
 
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 
83 83
             $master .= sprintf('%s %s %s %s %s',
84 84
                 str_pad($rr->getName(), $namePadding, ' ', STR_PAD_RIGHT),
85
-                str_pad($rr->getTtl(),  $ttlPadding,  ' ', STR_PAD_RIGHT),
86
-                str_pad($rr->getClass(), 2,           ' ', STR_PAD_RIGHT),
85
+                str_pad($rr->getTtl(), $ttlPadding, ' ', STR_PAD_RIGHT),
86
+                str_pad($rr->getClass(), 2, ' ', STR_PAD_RIGHT),
87 87
                 str_pad($rr->getType(), $typePadding, ' ', STR_PAD_RIGHT),
88 88
                 ($rdata instanceof FormattableInterface) ? $rdata->outputFormatted() : $rdata->output()
89 89
             );
90 90
 
91 91
             if (null != $rr->getComment()) {
92
-                $master .= ResourceRecord::COMMENT_DELIMINATOR.$rr->getComment();
92
+                $master .= ResourceRecord::COMMENT_DELIMINATOR . $rr->getComment();
93 93
             }
94 94
 
95 95
             $master .= PHP_EOL;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     public static function compareResourceRecords(ResourceRecord $a, ResourceRecord $b)
110 110
     {
111 111
         if ($a->getType() === $b->getType()) {
112
-            return strcmp($a->getName().$a->getRdata()->output(), $b->getName().$b->getRdata()->output());
112
+            return strcmp($a->getName() . $a->getRdata()->output(), $b->getName() . $b->getRdata()->output());
113 113
         }
114 114
 
115 115
         $_a = array_search($a->getType(), self::$order);
Please login to merge, or discard this patch.
lib/Rdata/FormattableTrait.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     {
50 50
         $pad = $this->longestVarLength();
51 51
         $output = str_repeat(' ', $this->padding).
52
-                  str_pad($text, $pad);
52
+                    str_pad($text, $pad);
53 53
 
54 54
         if (null !== $comment) {
55 55
             $output .= ' '.ResourceRecord::COMMENT_DELIMINATOR.$comment;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@
 block discarded – undo
48 48
     private function makeLine($text, $comment = null)
49 49
     {
50 50
         $pad = $this->longestVarLength();
51
-        $output = str_repeat(' ', $this->padding).
51
+        $output = str_repeat(' ', $this->padding) .
52 52
                   str_pad($text, $pad);
53 53
 
54 54
         if (null !== $comment) {
55
-            $output .= ' '.ResourceRecord::COMMENT_DELIMINATOR.$comment;
55
+            $output .= ' ' . ResourceRecord::COMMENT_DELIMINATOR . $comment;
56 56
         }
57 57
         $output .= PHP_EOL;
58 58
 
Please login to merge, or discard this patch.
lib/Rdata/LocRdata.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -238,12 +238,12 @@
 block discarded – undo
238 238
         $l = 0;
239 239
 
240 240
         foreach (array(
241
-                     $this->getLatitude(self::FORMAT_DMS),
242
-                     $this->getLongitude(self::FORMAT_DMS),
243
-                     sprintf('%.2fm', $this->altitude),
244
-                     sprintf('%.2fm', $this->size),
245
-                     sprintf('%.2fm', $this->horizontalPrecision),
246
-                     sprintf('%.2fm', $this->verticalPrecision),
241
+                        $this->getLatitude(self::FORMAT_DMS),
242
+                        $this->getLongitude(self::FORMAT_DMS),
243
+                        sprintf('%.2fm', $this->altitude),
244
+                        sprintf('%.2fm', $this->size),
245
+                        sprintf('%.2fm', $this->horizontalPrecision),
246
+                        sprintf('%.2fm', $this->verticalPrecision),
247 247
                 ) as $var) {
248 248
             $l = ($l < strlen($var)) ? strlen($var) : $l;
249 249
         }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -218,14 +218,14 @@
 block discarded – undo
218 218
      */
219 219
     public function outputFormatted()
220 220
     {
221
-        return ResourceRecord::MULTILINE_BEGIN.PHP_EOL.
222
-            $this->makeLine($this->getLatitude(self::FORMAT_DMS), 'LATITUDE').
223
-            $this->makeLine($this->getLongitude(self::FORMAT_DMS), 'LONGITUDE').
224
-            $this->makeLine(sprintf('%.2fm', $this->altitude), 'ALTITUDE').
225
-            $this->makeLine(sprintf('%.2fm', $this->size), 'SIZE').
226
-            $this->makeLine(sprintf('%.2fm', $this->horizontalPrecision), 'HORIZONTAL PRECISION').
227
-            $this->makeLine(sprintf('%.2fm', $this->verticalPrecision), 'VERTICAL PRECISION').
228
-            str_repeat(' ', $this->padding).ResourceRecord::MULTILINE_END;
221
+        return ResourceRecord::MULTILINE_BEGIN . PHP_EOL .
222
+            $this->makeLine($this->getLatitude(self::FORMAT_DMS), 'LATITUDE') .
223
+            $this->makeLine($this->getLongitude(self::FORMAT_DMS), 'LONGITUDE') .
224
+            $this->makeLine(sprintf('%.2fm', $this->altitude), 'ALTITUDE') .
225
+            $this->makeLine(sprintf('%.2fm', $this->size), 'SIZE') .
226
+            $this->makeLine(sprintf('%.2fm', $this->horizontalPrecision), 'HORIZONTAL PRECISION') .
227
+            $this->makeLine(sprintf('%.2fm', $this->verticalPrecision), 'VERTICAL PRECISION') .
228
+            str_repeat(' ', $this->padding) . ResourceRecord::MULTILINE_END;
229 229
     }
230 230
 
231 231
     /**
Please login to merge, or discard this patch.
lib/Rdata/MxRdata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,6 +72,6 @@
 block discarded – undo
72 72
      */
73 73
     public function output()
74 74
     {
75
-        return $this->preference.' '.$this->exchange;
75
+        return $this->preference . ' ' . $this->exchange;
76 76
     }
77 77
 }
Please login to merge, or discard this patch.
lib/Rdata/SoaRdata.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -226,15 +226,15 @@
 block discarded – undo
226 226
      */
227 227
     public function outputFormatted()
228 228
     {
229
-        return ResourceRecord::MULTILINE_BEGIN.PHP_EOL.
230
-            $this->makeLine($this->getMname(),   'MNAME').
231
-            $this->makeLine($this->getRname(),   'RNAME').
232
-            $this->makeLine($this->getSerial(),  'SERIAL').
233
-            $this->makeLine($this->getRefresh(), 'REFRESH').
234
-            $this->makeLine($this->getRetry(),   'RETRY').
235
-            $this->makeLine($this->getExpire(),  'EXPIRE').
236
-            $this->makeLine($this->getMinimum(), 'MINIMUM').
237
-            str_repeat(' ', $this->padding).ResourceRecord::MULTILINE_END;
229
+        return ResourceRecord::MULTILINE_BEGIN . PHP_EOL .
230
+            $this->makeLine($this->getMname(), 'MNAME') .
231
+            $this->makeLine($this->getRname(), 'RNAME') .
232
+            $this->makeLine($this->getSerial(), 'SERIAL') .
233
+            $this->makeLine($this->getRefresh(), 'REFRESH') .
234
+            $this->makeLine($this->getRetry(), 'RETRY') .
235
+            $this->makeLine($this->getExpire(), 'EXPIRE') .
236
+            $this->makeLine($this->getMinimum(), 'MINIMUM') .
237
+            str_repeat(' ', $this->padding) . ResourceRecord::MULTILINE_END;
238 238
     }
239 239
 
240 240
     /**
Please login to merge, or discard this patch.
lib/Rdata/TxtRdata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
      */
41 41
     public function output()
42 42
     {
43
-        return '"'.$this->text.'"';
43
+        return '"' . $this->text . '"';
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
lib/RdataRegisterTrait.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@
 block discarded – undo
38 38
     {
39 39
         if (!is_subclass_of($fqcn, '\\Badcow\\DNS\\Rdata\\RdataInterface')) {
40 40
             throw new \InvalidArgumentException(sprintf(
41
-               'The class "%s" is not an instance of Badcow\DNS\Rdata\RdataInterface',
42
-               $fqcn
43
-           ));
41
+                'The class "%s" is not an instance of Badcow\DNS\Rdata\RdataInterface',
42
+                $fqcn
43
+            ));
44 44
         }
45 45
 
46 46
         $this->rdataTypes[$type] = $fqcn;
Please login to merge, or discard this patch.
lib/ZoneBuilder.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     public function build(ZoneInterface $zone)
20 20
     {
21 21
         $master = '$ORIGIN '.$zone->getName().PHP_EOL.
22
-                  '$TTL '.$zone->getDefaultTtl().PHP_EOL;
22
+                    '$TTL '.$zone->getDefaultTtl().PHP_EOL;
23 23
 
24 24
         foreach ($zone->getResourceRecords() as $rr) {
25 25
             /* @var $rr ResourceRecord */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function build(ZoneInterface $zone)
20 20
     {
21
-        $master = '$ORIGIN '.$zone->getName().PHP_EOL.
22
-                  '$TTL '.$zone->getDefaultTtl().PHP_EOL;
21
+        $master = '$ORIGIN ' . $zone->getName() . PHP_EOL .
22
+                  '$TTL ' . $zone->getDefaultTtl() . PHP_EOL;
23 23
 
24 24
         foreach ($zone->getResourceRecords() as $rr) {
25 25
             /* @var $rr ResourceRecord */
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             }
35 35
 
36 36
             if (null !== $rr->getComment()) {
37
-                $master .= ResourceRecord::COMMENT_DELIMINATOR.$rr->getComment();
37
+                $master .= ResourceRecord::COMMENT_DELIMINATOR . $rr->getComment();
38 38
             }
39 39
 
40 40
             $master .= PHP_EOL;
Please login to merge, or discard this patch.