Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 30, 2019
1 parent 6537549 commit a52a0dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions src/Illuminate/Log/LogManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ public function driver($driver = null)
return $this->get($driver ?? $this->getDefaultDriver());
}

/**
* @param string|null $driver
* @return void
*/
public function purge($driver = null)
{
$driver = $driver ?? $this->getDefaultDriver();

if (isset($this->channels[$driver])) {
unset($this->channels[$driver]);
}
}

/**
* @return array
*/
Expand Down Expand Up @@ -479,6 +466,21 @@ public function extend($driver, Closure $callback)
return $this;
}

/**
* Unset the given channel instance.
*
* @param string|null $name
* @return $this
*/
public function forgetChannel($driver = null)
{
$driver = $driver ?? $this->getDefaultDriver();

if (isset($this->channels[$driver])) {
unset($this->channels[$driver]);
}
}

/**
* System is unusable.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Log/LogManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function testLogMnagerPurgeResolvedChannels()

$this->assertCount(1, $manager->getChannels());

$manager->purge('single');
$manager->forgetChannel('single');

$this->assertEmpty($manager->getChannels());
}
Expand Down

0 comments on commit a52a0dd

Please sign in to comment.