Skip to content

Commit

Permalink
Use static function.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Aug 4, 2019
1 parent 7d11069 commit 9ab2798
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Concerns/CreatesApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ final protected function resolveApplicationAliases($app): array
$overrides = $this->overrideApplicationAliases($app);

if (! empty($overrides)) {
$aliases->transform(function ($alias, $name) use ($overrides) {
$aliases->transform(static function ($alias, $name) use ($overrides) {
return $overrides[$name] ?? $alias;
});
}
Expand Down Expand Up @@ -152,7 +152,7 @@ final protected function resolveApplicationProviders($app): array
$overrides = $this->overrideApplicationProviders($app);

if (! empty($overrides)) {
$providers->transform(function ($provider) use ($overrides) {
$providers->transform(static function ($provider) use ($overrides) {
return $overrides[$provider] ?? $provider;
});
}
Expand Down Expand Up @@ -211,7 +211,7 @@ public function createApplication()
*/
protected function resolveApplication()
{
return \tap(new Application($this->getBasePath()), function ($app) {
return \tap(new Application($this->getBasePath()), static function ($app) {
$app->bind(
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
'Orchestra\Testbench\Bootstrap\LoadConfiguration'
Expand All @@ -230,7 +230,7 @@ protected function resolveApplicationConfiguration($app)
{
$app->make('Illuminate\Foundation\Bootstrap\LoadConfiguration')->bootstrap($app);

\tap($this->getApplicationTimezone($app), function ($timezone) {
\tap($this->getApplicationTimezone($app), static function ($timezone) {
! \is_null($timezone) && \date_default_timezone_set($timezone);
});

Expand All @@ -250,7 +250,7 @@ protected function resolveApplicationCore($app)
Facade::clearResolvedInstances();
Facade::setFacadeApplication($app);

$app->detectEnvironment(function () {
$app->detectEnvironment(static function () {
return 'testing';
});
}
Expand Down Expand Up @@ -317,7 +317,7 @@ protected function resolveApplicationBootstrappers($app)

$app['router']->getRoutes()->refreshNameLookups();

$app->resolving('url', function ($url, $app) {
$app->resolving('url', static function ($url, $app) {
$app['router']->getRoutes()->refreshNameLookups();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/WithLaravelMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function loadLaravelMigrations($database = []): void

$this->resetApplicationArtisanCommands($this->app);

$this->beforeApplicationDestroyed(function () use ($migrator) {
$this->beforeApplicationDestroyed(static function () use ($migrator) {
$migrator->rollback();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/WithLoadMigrationsFrom.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function loadMigrationsFrom($paths): void

$this->resetApplicationArtisanCommands($this->app);

$this->beforeApplicationDestroyed(function () use ($migrator) {
$this->beforeApplicationDestroyed(static function () use ($migrator) {
$migrator->rollback();
});
}
Expand Down

0 comments on commit 9ab2798

Please sign in to comment.