diff --git a/src/Helper.php b/src/Helper.php index 46c5c6f..e1c8ecf 100644 --- a/src/Helper.php +++ b/src/Helper.php @@ -16,7 +16,7 @@ class Helper * @param string $type The type of the resource record. * @param array|string $content The content of the resource record. * @param int $ttl The TTL. - * @param array $comments The Comment. + * @param array $comments The Comment. * * @throws Exceptions\InvalidRecordType If the given type is invalid. * @@ -51,7 +51,7 @@ public static function createResourceRecord( ->setName($name) ->setType($type) ->setTtl($ttl); - + if (is_string($content)) { $content = [$content]; } diff --git a/src/Transformers/RRSetTransformer.php b/src/Transformers/RRSetTransformer.php index dbf998e..82ed7f1 100644 --- a/src/Transformers/RRSetTransformer.php +++ b/src/Transformers/RRSetTransformer.php @@ -41,9 +41,9 @@ private function transformResourceRecord(ResourceRecord $resourceRecord) 'ttl' => $resourceRecord->getTtl(), 'changetype' => $resourceRecord->getChangeType(), 'records' => $recordList, - 'comments' => array_map(function($comment) { + 'comments' => array_map(function ($comment) { return (new CommentTransformer($comment))->transform(); - } ,$resourceRecord->getComments()) + }, $resourceRecord->getComments()), ]; } diff --git a/src/Zone.php b/src/Zone.php index 2aa59d6..4a2a6b9 100644 --- a/src/Zone.php +++ b/src/Zone.php @@ -25,7 +25,7 @@ class Zone extends AbstractZone * @param string $type The type of the resource record. * @param mixed[]|string $content The content of the resource record. When passing a multidimensional array, * multiple records are created for this resource record. - * @param mixed[]|array $comments The comment to assign to the record. + * @param array|mixed[] $comments The comment to assign to the record. * @param int $ttl The TTL. * * @throws Exceptions\InvalidRecordType If the given type is invalid. diff --git a/tests/Resources/CommentTest.php b/tests/Resources/CommentTest.php index 08af106..4c817b9 100644 --- a/tests/Resources/CommentTest.php +++ b/tests/Resources/CommentTest.php @@ -37,7 +37,7 @@ public function testTransformer(): void $this->assertEquals((object) [ 'modified_at' => 1234, 'account' => 'test account', - 'content' => 'test content' + 'content' => 'test content', ], $transformer->transform()); } } diff --git a/tests/functional/ZoneRecordsTest.php b/tests/functional/ZoneRecordsTest.php index 6e461a7..8613a05 100644 --- a/tests/functional/ZoneRecordsTest.php +++ b/tests/functional/ZoneRecordsTest.php @@ -27,7 +27,7 @@ class ZoneRecordsTest extends FunctionalTestCase 'name' => '@', 'type' => RecordType::SOA, 'content' => 'ns1.test. hostmaster.test. 0 10800 3605 604800 3600', - 'ttl' => 60, + 'ttl' => 60, 'comments' => [], ], ['name' => '@', 'type' => RecordType::NS, 'content' => 'ns1.powerdns-php.', 'ttl' => 60, 'comments' => []], @@ -90,7 +90,7 @@ function (ResourceRecord $item) use (&$createdRecords) { 'type' => $item->getType(), 'content' => $content, 'ttl' => $item->getTtl(), - 'comments' => [] + 'comments' => [], ]; } }