Skip to content

Commit eb378fc

Browse files
authored
[8.x] Revert #38628 (#38651)
* Revert "Apply fixes from StyleCI" This reverts commit cdb14c7. * Revert "[8.x] Adds dynamic properties to `AnonymousNotifiable` (#38628)" This reverts commit 9f9b737.
1 parent 0a38fd6 commit eb378fc

File tree

2 files changed

+1
-67
lines changed

2 files changed

+1
-67
lines changed

src/Illuminate/Notifications/AnonymousNotifiable.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
namespace Illuminate\Notifications;
44

5-
use BadMethodCallException;
65
use Illuminate\Contracts\Notifications\Dispatcher;
7-
use Illuminate\Contracts\Support\Arrayable;
8-
use Illuminate\Support\Fluent;
96
use InvalidArgumentException;
107

11-
class AnonymousNotifiable extends Fluent
8+
class AnonymousNotifiable
129
{
1310
/**
1411
* All of the notification routing information.
@@ -37,23 +34,6 @@ public function route($channel, $route)
3734
return $this;
3835
}
3936

40-
/**
41-
* Add dynamic properties to the instance.
42-
*
43-
* @param \Illuminate\Contracts\Support\Arrayable|array $attributes
44-
* @return $this
45-
*/
46-
public function with($attributes)
47-
{
48-
if ($attributes instanceof Arrayable) {
49-
$attributes = $attributes->toArray();
50-
}
51-
52-
$this->attributes = array_merge($this->attributes, $attributes);
53-
54-
return $this;
55-
}
56-
5737
/**
5838
* Send the given notification.
5939
*
@@ -96,18 +76,4 @@ public function getKey()
9676
{
9777
//
9878
}
99-
100-
/**
101-
* Disable dynamic calls to set a parameter value.
102-
*
103-
* @param string $method
104-
* @param array $parameters
105-
* @return void
106-
*/
107-
public function __call($method, $parameters)
108-
{
109-
throw new BadMethodCallException(sprintf(
110-
'Call to undefined method %s::%s()', static::class, $method
111-
));
112-
}
11379
}

tests/Integration/Notifications/SendingNotificationsViaAnonymousNotifiableTest.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Illuminate\Tests\Integration\Notifications;
44

5-
use BadMethodCallException;
65
use Illuminate\Notifications\AnonymousNotifiable;
76
use Illuminate\Notifications\Notification;
87
use Illuminate\Support\Facades\Notification as NotificationFacade;
@@ -37,22 +36,6 @@ public function testMailIsSent()
3736
], $_SERVER['__notifiable.route']);
3837
}
3938

40-
public function testAnonymousNotifiableWithProperties()
41-
{
42-
NotificationFacade::route('testchannel', 'enzo')
43-
->with(['foo' => 'bar'])
44-
->notify(new AnonymousTestNotificationWithProperties($this));
45-
}
46-
47-
public function testAnonymouseNotifiableDoesntAllowSetCalls()
48-
{
49-
$this->expectException(BadMethodCallException::class);
50-
$this->expectExceptionMessage('Call to undefined method Illuminate\Notifications\AnonymousNotifiable::foo()');
51-
52-
NotificationFacade::route('testchannel', 'enzo')
53-
->foo('bar');
54-
}
55-
5639
public function testFaking()
5740
{
5841
$fake = NotificationFacade::fake();
@@ -101,18 +84,3 @@ public function send($notifiable, $notification)
10184
$_SERVER['__notifiable.route'][] = $notifiable->routeNotificationFor('anothertestchannel');
10285
}
10386
}
104-
105-
class AnonymousTestNotificationWithProperties extends Notification
106-
{
107-
public function __construct($test)
108-
{
109-
$this->test = $test;
110-
}
111-
112-
public function via($notifiable)
113-
{
114-
$this->test->assertSame('bar', $notifiable->foo);
115-
116-
return [TestCustomChannel::class];
117-
}
118-
}

0 commit comments

Comments
 (0)