Skip to content

Commit 183845f

Browse files
committed
Apply fixes from StyleCI
1 parent 01aacd5 commit 183845f

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

src/Models/Zones/RRSet.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ class RRSet extends Model implements Resource
2424
/**
2525
* Creates a new RRSet. This is useful if you want to create a new RRSet to pass to the createRRSet method of a Zone.
2626
*
27-
* @param string $name
28-
* @param string $type
29-
* @param array $records
30-
* @param int|null $ttl
31-
* @param array|null $labels
27+
* @param string $name
28+
* @param string $type
29+
* @param array $records
30+
* @param int|null $ttl
31+
* @param array|null $labels
3232
* @return RRSet|null
3333
*/
3434
public static function create(string $name, string $type, array $records, ?int $ttl = null, ?array $labels = []): ?RRSet
3535
{
36-
return (new RRset(""))->setAdditionalData((object)[
36+
return (new RRset(''))->setAdditionalData((object) [
3737
'name' => $name,
3838
'type' => $type,
3939
'ttl' => $ttl,
4040
'records' => $records,
41-
'labels' => (object)$labels,
42-
'protection' => (object)[],
41+
'labels' => (object) $labels,
42+
'protection' => (object) [],
4343
'zone' => 0,
4444
]);
4545
}

tests/Unit/Models/Zones/ZonesTest.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use LKDev\HetznerCloud\Models\Zones\PrimaryNameserver;
77
use LKDev\HetznerCloud\Models\Zones\Record;
88
use LKDev\HetznerCloud\Models\Zones\RRSet;
9-
use LKDev\HetznerCloud\Models\Zones\RRSetProtection;
109
use LKDev\HetznerCloud\Models\Zones\ZoneMode;
1110
use LKDev\HetznerCloud\Models\zones\zones;
1211
use LKDev\Tests\TestCase;
@@ -26,7 +25,7 @@ public function setUp(): void
2625

2726
public function testCreatePrimarySimple()
2827
{
29-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zone_create.json')));
28+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zone_create.json')));
3029
$resp = $this->zones->create('example.com', ZoneMode::PRIMARY);
3130

3231
$Zone = $resp->getResponsePart('zone');
@@ -41,11 +40,11 @@ public function testCreatePrimarySimple()
4140

4241
public function testCreatePrimaryFull()
4342
{
44-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zone_create.json')));
43+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zone_create.json')));
4544
$resp = $this->zones->create('example.com', ZoneMode::PRIMARY, 10, ['key' => 'value'], [], [
46-
(RRSet::create('@', 'A', [
45+
RRSet::create('@', 'A', [
4746
new Record('192.0.2.1', 'my comment'),
48-
], 3600, [])),
47+
], 3600, []),
4948
]);
5049

5150
$Zone = $resp->getResponsePart('zone');
@@ -64,10 +63,10 @@ public function testCreatePrimaryFull()
6463

6564
public function testCreateSecondary()
6665
{
67-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zone_create.json')));
66+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zone_create.json')));
6867
$resp = $this->zones->create('example.com', ZoneMode::SECONDARY, 10, ['key' => 'value'], [
6968
new PrimaryNameserver('192.168.178.1', 53),
70-
],);
69+
], );
7170

7271
$Zone = $resp->getResponsePart('zone');
7372
$this->assertEquals($Zone->id, 4711);
@@ -86,7 +85,7 @@ public function testCreateSecondary()
8685

8786
public function testGetByName()
8887
{
89-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zone.json')));
88+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zone.json')));
9089
$Zone = $this->zones->getByName('example.com');
9190
$this->assertEquals(4711, $Zone->id);
9291
$this->assertEquals('example.com', $Zone->name);
@@ -96,7 +95,7 @@ public function testGetByName()
9695

9796
public function testGet()
9897
{
99-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zone.json')));
98+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zone.json')));
10099
$Zone = $this->zones->get(4711);
101100
$this->assertEquals($Zone->id, 4711);
102101
$this->assertEquals($Zone->name, 'example.com');
@@ -106,7 +105,7 @@ public function testGet()
106105

107106
public function testAll()
108107
{
109-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zones.json')));
108+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zones.json')));
110109
$zones = $this->zones->all();
111110
$this->assertCount(1, $zones);
112111
$Zone = $zones[0];
@@ -118,7 +117,7 @@ public function testAll()
118117

119118
public function testList()
120119
{
121-
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__ . '/fixtures/zones.json')));
120+
$this->mockHandler->append(new Response(200, [], file_get_contents(__DIR__.'/fixtures/zones.json')));
122121
$zones = $this->zones->list()->zones;
123122
$this->assertCount(1, $zones);
124123
$Zone = $zones[0];

0 commit comments

Comments
 (0)