Skip to content

Commit

Permalink
style(BetaAPI): remove useless line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldogedev committed Dec 23, 2023
1 parent a89f3fc commit 62e8d08
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/cooldogedev/BedrockEconomy/api/type/BetaAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,34 @@ public function getVersion(): string
public function get(string $player): Promise
{
$promise = new PromiseResolver();

BedrockEconomyAPI::CLOSURE()->get(Search::EMPTY, $player, fn(int $amount) => $promise->resolve($amount), fn() => $promise->reject());

return $promise->getPromise();
}

public function set(string $player, int $amount): Promise
{
$promise = new PromiseResolver();

BedrockEconomyAPI::CLOSURE()->set(Search::EMPTY, $player, $amount, 0, fn(bool $success) => $promise->resolve($success), fn() => $promise->reject());

return $promise->getPromise();
}

public function add(string $player, int $amount): Promise
{
$promise = new PromiseResolver();

BedrockEconomyAPI::CLOSURE()->add(Search::EMPTY, $player, $amount, 0, fn(bool $success) => $promise->resolve($success), fn() => $promise->reject());

return $promise->getPromise();
}

public function deduct(string $player, int $amount): Promise
{
$promise = new PromiseResolver();

BedrockEconomyAPI::CLOSURE()->subtract(Search::EMPTY, $player, $amount, 0, fn(bool $success) => $promise->resolve($success), fn() => $promise->reject());

return $promise->getPromise();
}

public function transfer(string $source, string $target, int $amount): Promise
{
$promise = new PromiseResolver();

BedrockEconomyAPI::CLOSURE()->transfer(
source: [
"xuid" => Search::EMPTY,
Expand All @@ -105,7 +96,6 @@ public function transfer(string $source, string $target, int $amount): Promise
onSuccess: fn() => $promise->resolve(true),
onError: fn() => $promise->reject()
);

return $promise->getPromise();
}
}

0 comments on commit 62e8d08

Please sign in to comment.