@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @param $name |
|
| 86 | + * @param string $name |
|
| 87 | 87 | * |
| 88 | 88 | * @throws DNSException |
| 89 | 89 | */ |
@@ -49,7 +49,7 @@ |
||
| 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; |
@@ -48,8 +48,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -49,7 +49,7 @@ |
||
| 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; |
@@ -48,11 +48,11 @@ |
||
| 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 | |
@@ -238,12 +238,12 @@ |
||
| 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 | } |
@@ -218,14 +218,14 @@ |
||
| 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 | /** |
@@ -72,6 +72,6 @@ |
||
| 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 | } |
@@ -226,15 +226,15 @@ |
||
| 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 | /** |
@@ -40,6 +40,6 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function output() |
| 42 | 42 | { |
| 43 | - return '"'.$this->text.'"'; |
|
| 43 | + return '"' . $this->text . '"'; |
|
| 44 | 44 | } |
| 45 | 45 | } |
@@ -38,9 +38,9 @@ |
||
| 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; |
@@ -19,7 +19,7 @@ |
||
| 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 */ |
@@ -18,8 +18,8 @@ discard block |
||
| 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 |
||
| 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; |