Skip to content

Commit 2971b64

Browse files
committed
formatting
1 parent 79a0961 commit 2971b64

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/Illuminate/Container/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ public function forgetInstances()
13491349
*
13501350
* @return void
13511351
*/
1352-
public function resetScope()
1352+
public function forgetScopedInstances()
13531353
{
13541354
foreach ($this->scopedInstances as $scoped) {
13551355
unset($this->instances[$scoped]);

src/Illuminate/Queue/QueueServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,16 @@ protected function registerWorker()
166166
return $this->app->isDownForMaintenance();
167167
};
168168

169-
$scopeResetter = function () use ($app) {
170-
return $app->resetScope();
169+
$resetScope = function () use ($app) {
170+
return $app->forgetScopedInstances();
171171
};
172172

173173
return new Worker(
174174
$app['queue'],
175175
$app['events'],
176176
$app[ExceptionHandler::class],
177177
$isDownForMaintenance,
178-
$scopeResetter
178+
$resetScope
179179
);
180180
});
181181
}

src/Illuminate/Queue/Worker.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ class Worker
6666
protected $isDownForMaintenance;
6767

6868
/**
69-
* The callback used to reset the application scope.
69+
* The callback used to reset the application's scope.
7070
*
7171
* @var callable
7272
*/
73-
protected $scopeResetter;
73+
protected $resetScope;
7474

7575
/**
7676
* Indicates if the worker should exit.
@@ -100,20 +100,20 @@ class Worker
100100
* @param \Illuminate\Contracts\Events\Dispatcher $events
101101
* @param \Illuminate\Contracts\Debug\ExceptionHandler $exceptions
102102
* @param callable $isDownForMaintenance
103-
* @param callable|null $scopeResetter
103+
* @param callable|null $resetScope
104104
* @return void
105105
*/
106106
public function __construct(QueueManager $manager,
107107
Dispatcher $events,
108108
ExceptionHandler $exceptions,
109109
callable $isDownForMaintenance,
110-
callable $scopeResetter = null)
110+
callable $resetScope = null)
111111
{
112112
$this->events = $events;
113113
$this->manager = $manager;
114114
$this->exceptions = $exceptions;
115115
$this->isDownForMaintenance = $isDownForMaintenance;
116-
$this->scopeResetter = $scopeResetter;
116+
$this->resetScope = $resetScope;
117117
}
118118

119119
/**
@@ -148,8 +148,8 @@ public function daemon($connectionName, $queue, WorkerOptions $options)
148148
continue;
149149
}
150150

151-
if (isset($this->scopeResetter)) {
152-
($this->scopeResetter)();
151+
if (isset($this->resetScope)) {
152+
($this->resetScope)();
153153
}
154154

155155
// First, we will attempt to get the next job off of the queue. We will also

tests/Container/ContainerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testScopedClosureResets()
125125
});
126126
$firstInstantiation = $container->make('class');
127127

128-
$container->resetScope();
128+
$container->forgetScopedInstances();
129129

130130
$secondInstantiation = $container->make('class');
131131
$this->assertNotSame($firstInstantiation, $secondInstantiation);
@@ -154,7 +154,7 @@ public function testScopedConcreteResolutionResets()
154154

155155
$var1 = $container->make(ContainerConcreteStub::class);
156156

157-
$container->resetScope();
157+
$container->forgetScopedInstances();
158158

159159
$var2 = $container->make(ContainerConcreteStub::class);
160160

0 commit comments

Comments
 (0)