diff --git a/.travis.yml b/.travis.yml index 60eb53265..4e11ad58d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: php php: - '7.1' - '7.2' +- '7.3' before_script: - "composer install" diff --git a/composer.json b/composer.json index 4dea81e69..23d4337ae 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ ], "require": { "php": "^7.1", - "laravel/framework": "~5.5.0|~5.6.0|~5.7.0" + "laravel/framework": "~5.5.0|~5.6.0|~5.7.0", + "ramsey/uuid": "^3.0" }, "require-dev": { "doctrine/dbal": "^2.8", diff --git a/src/Traits/HasWallet.php b/src/Traits/HasWallet.php index ce63815ba..c85c76e0f 100644 --- a/src/Traits/HasWallet.php +++ b/src/Traits/HasWallet.php @@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Str; +use Ramsey\Uuid\Uuid; /** * Class HasWallet @@ -141,6 +141,7 @@ public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): * @param Transaction $withdraw * @param Transaction $deposit * @return Transfer + * @throws */ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $deposit): Transfer { @@ -154,7 +155,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $ 'from_id' => $this->getKey(), 'to_type' => $wallet->getMorphClass(), 'to_id' => $wallet->getKey(), - 'uuid' => Str::uuid()->toString(), + 'uuid' => Uuid::uuid4()->toString(), ]); } @@ -163,6 +164,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $ * @param array|null $meta * @param bool $confirmed * @return Transaction + * @throws */ protected function change(int $amount, ?array $meta, bool $confirmed): Transaction { @@ -172,7 +174,7 @@ protected function change(int $amount, ?array $meta, bool $confirmed): Transacti 'type' => $amount > 0 ? 'deposit' : 'withdraw', 'payable_type' => $this->getMorphClass(), 'payable_id' => $this->getKey(), - 'uuid' => Str::uuid()->toString(), + 'uuid' => Uuid::uuid4()->toString(), 'confirmed' => $confirmed, 'amount' => $amount, 'meta' => $meta,