Skip to content

Commit

Permalink
Rename export function
Browse files Browse the repository at this point in the history
This should be less confusing
  • Loading branch information
Nadyita committed Feb 20, 2024
1 parent 04055ac commit cc9d2b1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/BasicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function read(): ?Package\In {
}

public function write(Package\Out $package): void {
$binPackage = $package->toBinary();
$binPackage = $package->toBinaryPackage();
$this->connection->write($binPackage->toBinary());
}

Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __toString() {
return "<{$class}>{" . join(",", $values) . "}";
}

public function toBinary(): BinaryPackage {
public function toBinaryPackage(): BinaryPackage {
$type = $this->type;
$format = $this->getFormat();
$values = $this->getPackageValues();
Expand Down
4 changes: 2 additions & 2 deletions src/Package/In.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use AO\{BinaryPackage, Package};

abstract class In extends Package {
public function toBinary(): BinaryPackage\In {
$package = parent::toBinary();
public function toBinaryPackage(): BinaryPackage\In {
$package = parent::toBinaryPackage();
return new BinaryPackage\In(
type: $package->type,
length: $package->length,
Expand Down
4 changes: 2 additions & 2 deletions src/Package/Out.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use AO\{BinaryPackage, Package};

abstract class Out extends Package {
public function toBinary(): BinaryPackage\Out {
$package = parent::toBinary();
public function toBinaryPackage(): BinaryPackage\Out {
$package = parent::toBinaryPackage();
return new BinaryPackage\Out(
type: $package->type,
length: $package->length,
Expand Down
2 changes: 1 addition & 1 deletion tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function examplePackages(): array {
#[DataProvider('examplePackages')]
public function testPackagesBackAndForth(Package $package): void {
$parser = Parser::createDefault(TestLogger::create());
$binPackage = $package->toBinary();
$binPackage = $package->toBinaryPackage();
$this->assertInstanceOf(BinaryPackage::class, $binPackage);
$reconverted = $parser->parseBinaryPackage($binPackage);
$this->assertSame(serialize($package), serialize($reconverted));
Expand Down

0 comments on commit cc9d2b1

Please sign in to comment.