diff --git a/src/Illuminate/Notifications/AnonymousNotifiable.php b/src/Illuminate/Notifications/AnonymousNotifiable.php index 79573a69ea4d..aa4d7bbc7b42 100644 --- a/src/Illuminate/Notifications/AnonymousNotifiable.php +++ b/src/Illuminate/Notifications/AnonymousNotifiable.php @@ -2,13 +2,10 @@ namespace Illuminate\Notifications; -use BadMethodCallException; use Illuminate\Contracts\Notifications\Dispatcher; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Support\Fluent; use InvalidArgumentException; -class AnonymousNotifiable extends Fluent +class AnonymousNotifiable { /** * All of the notification routing information. @@ -37,23 +34,6 @@ public function route($channel, $route) return $this; } - /** - * Add dynamic properties to the instance. - * - * @param \Illuminate\Contracts\Support\Arrayable|array $attributes - * @return $this - */ - public function with($attributes) - { - if ($attributes instanceof Arrayable) { - $attributes = $attributes->toArray(); - } - - $this->attributes = array_merge($this->attributes, $attributes); - - return $this; - } - /** * Send the given notification. * @@ -96,18 +76,4 @@ public function getKey() { // } - - /** - * Disable dynamic calls to set a parameter value. - * - * @param string $method - * @param array $parameters - * @return void - */ - public function __call($method, $parameters) - { - throw new BadMethodCallException(sprintf( - 'Call to undefined method %s::%s()', static::class, $method - )); - } } diff --git a/tests/Integration/Notifications/SendingNotificationsViaAnonymousNotifiableTest.php b/tests/Integration/Notifications/SendingNotificationsViaAnonymousNotifiableTest.php index 12a20f5a6efa..af87372c3bdc 100644 --- a/tests/Integration/Notifications/SendingNotificationsViaAnonymousNotifiableTest.php +++ b/tests/Integration/Notifications/SendingNotificationsViaAnonymousNotifiableTest.php @@ -2,7 +2,6 @@ namespace Illuminate\Tests\Integration\Notifications; -use BadMethodCallException; use Illuminate\Notifications\AnonymousNotifiable; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Notification as NotificationFacade; @@ -37,22 +36,6 @@ public function testMailIsSent() ], $_SERVER['__notifiable.route']); } - public function testAnonymousNotifiableWithProperties() - { - NotificationFacade::route('testchannel', 'enzo') - ->with(['foo' => 'bar']) - ->notify(new AnonymousTestNotificationWithProperties($this)); - } - - public function testAnonymouseNotifiableDoesntAllowSetCalls() - { - $this->expectException(BadMethodCallException::class); - $this->expectExceptionMessage('Call to undefined method Illuminate\Notifications\AnonymousNotifiable::foo()'); - - NotificationFacade::route('testchannel', 'enzo') - ->foo('bar'); - } - public function testFaking() { $fake = NotificationFacade::fake(); @@ -101,18 +84,3 @@ public function send($notifiable, $notification) $_SERVER['__notifiable.route'][] = $notifiable->routeNotificationFor('anothertestchannel'); } } - -class AnonymousTestNotificationWithProperties extends Notification -{ - public function __construct($test) - { - $this->test = $test; - } - - public function via($notifiable) - { - $this->test->assertSame('bar', $notifiable->foo); - - return [TestCustomChannel::class]; - } -}