Skip to content

Commit

Permalink
Suppress ramsey/uuid dependency in illuminate/notifications (#24318)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored and taylorotwell committed May 25, 2018
1 parent f7565df commit a580df5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Notifications/NotificationSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Illuminate\Notifications;

use Ramsey\Uuid\Uuid;
use Illuminate\Support\Str;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Queue\ShouldQueue;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function sendNow($notifiables, $notification, array $channels = null)
continue;
}

$notificationId = Uuid::uuid4()->toString();
$notificationId = Str::uuid()->toString();

foreach ((array) $viaChannels as $channel) {
$this->sendToNotifiable($notifiable, $notificationId, clone $original, $channel);
Expand Down Expand Up @@ -146,7 +146,7 @@ protected function queueNotification($notifiables, $notification)
$original = clone $notification;

foreach ($notifiables as $notifiable) {
$notificationId = Uuid::uuid4()->toString();
$notificationId = Str::uuid()->toString();

foreach ($original->via($notifiable) as $channel) {
$notification = clone $original;
Expand Down
3 changes: 1 addition & 2 deletions src/Illuminate/Notifications/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"illuminate/filesystem": "5.6.*",
"illuminate/mail": "5.6.*",
"illuminate/queue": "5.6.*",
"illuminate/support": "5.6.*",
"ramsey/uuid": "~3.0"
"illuminate/support": "5.6.*"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Testing/Fakes/NotificationFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Illuminate\Support\Testing\Fakes;

use Ramsey\Uuid\Uuid;
use Illuminate\Support\Str;
use Illuminate\Support\Collection;
use PHPUnit\Framework\Assert as PHPUnit;
use Illuminate\Contracts\Notifications\Factory as NotificationFactory;
Expand Down Expand Up @@ -175,7 +175,7 @@ public function sendNow($notifiables, $notification)

foreach ($notifiables as $notifiable) {
if (! $notification->id) {
$notification->id = Uuid::uuid4()->toString();
$notification->id = Str::uuid()->toString();
}

$this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [
Expand Down
6 changes: 3 additions & 3 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Illuminate\Tests\Support;

use Ramsey\Uuid\Uuid;
use Illuminate\Support\Str;
use Ramsey\Uuid\UuidInterface;
use PHPUnit\Framework\TestCase;

class SupportStrTest extends TestCase
Expand Down Expand Up @@ -289,8 +289,8 @@ public function testUcfirst()

public function testUuid()
{
$this->assertInstanceOf(Uuid::class, Str::uuid());
$this->assertInstanceOf(Uuid::class, Str::orderedUuid());
$this->assertInstanceOf(UuidInterface::class, Str::uuid());
$this->assertInstanceOf(UuidInterface::class, Str::orderedUuid());
}
}

Expand Down

0 comments on commit a580df5

Please sign in to comment.