Skip to content

Commit

Permalink
Remove ids entirely since they're unused and causing issues
Browse files Browse the repository at this point in the history
Release 0.8.0
  • Loading branch information
Pyker committed Oct 31, 2024
1 parent e174354 commit ccd964d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 31 deletions.
5 changes: 0 additions & 5 deletions src/Resources/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class Build
{
public ?string $id = null;
public string $minecraft;
public ?string $java = null;
public ?int $memory = 0;
Expand All @@ -16,10 +15,6 @@ class Build

public function __construct($properties)
{
if (array_key_exists('id', $properties)) {
$this->id = $properties['id'];
}

$this->minecraft = $properties['minecraft'];

if (array_key_exists('java', $properties)) {
Expand Down
1 change: 0 additions & 1 deletion src/Resources/Mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class Mod
{
public ?string $id = null;
public string $name = "";
public ?string $version = null;
public string $md5 = "";
Expand Down
1 change: 0 additions & 1 deletion src/Resources/Modpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class Modpack
{
public ?string $id = null;
public string $name = "";
public string $display_name = "";
public ?string $url = null;
Expand Down
2 changes: 1 addition & 1 deletion src/SolderClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SolderClient
public string $key;
private Client $client;

const VERSION = '0.7.6';
const VERSION = '0.8.0';

public static function factory($url, $key, $headers = [], $handler = null, $timeout = 3): SolderClient
{
Expand Down
17 changes: 0 additions & 17 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ public function testGetBuild()
$this->assertCount(1, $build->mods);

$mod = $build->mods[0];
$this->assertSame('30', $mod->id);
$this->assertSame('armorbar', $mod->name);
$this->assertSame('v0.7.1', $mod->version);
$this->assertSame('f323a8d582302ea0abd615a223f8a68b', $mod->md5);
Expand All @@ -314,20 +313,4 @@ public function testBadPack()
$this->expectException(ConnectionException::class);
SolderClient::factory('https://solder.example.net/api/', '', [], []);
}

public function testBuildUuid()
{
$props = [
'id' => '9e002c63-a8e5-47fa-b9a2-369f7ab9fe5d',
'minecraft' => '1.0',
];

$build = new Build($props);

$this->assertObjectHasProperty('id', $build);
$this->assertObjectHasProperty('minecraft', $build);

$this->assertSame('9e002c63-a8e5-47fa-b9a2-369f7ab9fe5d', $build->id);
$this->assertSame('1.0', $build->minecraft);
}
}
12 changes: 6 additions & 6 deletions tests/DynamicPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ class DynamicPropertiesTest extends TestCase
public function testMod()
{
$props = [
'id' => 1,
'name' => 'foo',
'extra' => 'stuff',
];

$mod = new Mod($props);

$this->assertTrue(property_exists($mod, 'id'));
$this->assertTrue(property_exists($mod, 'name'));
$this->assertFalse(property_exists($mod, 'extra'));

$this->assertSame('1', $mod->id);
$this->assertSame('foo', $mod->name);
}

public function testModpack()
{
$props = [
'id' => 1,
'name' => 'foo',
'extra' => 'stuff',
];

$modpack = new Modpack($props);

$this->assertTrue(property_exists($modpack, 'id'));
$this->assertTrue(property_exists($modpack, 'name'));
$this->assertFalse(property_exists($modpack, 'extra'));

$this->assertSame('1', $modpack->id);
$this->assertSame('foo', $modpack->name);
}
}

0 comments on commit ccd964d

Please sign in to comment.