mirror of
https://github.com/flarum/core.git
synced 2025-06-22 02:34:47 +02:00
Use anonymous class for FakeApp (#2725)
It's a better implementation than declaring a second class in the same file, which can confuse IDEs. Furthermore, FakeApp shouldn't be used outside this file.
This commit is contained in:
committed by
GitHub
parent
3cc18c1da2
commit
706eaeda41
@ -17,12 +17,7 @@ class Schedule extends LaravelSchedule
|
||||
{
|
||||
public function dueEvents($container)
|
||||
{
|
||||
return (new Collection($this->events))->filter->isDue(new FakeApp($container));
|
||||
}
|
||||
}
|
||||
|
||||
class FakeApp
|
||||
{
|
||||
return (new Collection($this->events))->filter->isDue(new class($container) {
|
||||
public function __construct($container)
|
||||
{
|
||||
$this->config = $container->make(Config::class);
|
||||
@ -37,4 +32,6 @@ class FakeApp
|
||||
{
|
||||
return '';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user