mirror of
https://github.com/flarum/framework.git
synced 2025-02-17 02:02:47 +08:00
chore: Remove unused vars in catch (#3839)
This commit is contained in:
parent
0cf2001478
commit
b003736d75
|
@ -64,7 +64,7 @@ class TagFilterGambit extends AbstractRegexGambit implements FilterInterface
|
||||||
// @TODO: grab all IDs first instead of multiple queries.
|
// @TODO: grab all IDs first instead of multiple queries.
|
||||||
try {
|
try {
|
||||||
$id = $this->slugger->forResource(Tag::class)->fromSlug($slug, $actor)->id;
|
$id = $this->slugger->forResource(Tag::class)->fromSlug($slug, $actor)->id;
|
||||||
} catch (ModelNotFoundException $e) {
|
} catch (ModelNotFoundException) {
|
||||||
$id = null;
|
$id = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class ApplicationInfoProvider
|
||||||
// Try to get the configured driver instance.
|
// Try to get the configured driver instance.
|
||||||
// Driver instances are created on demand.
|
// Driver instances are created on demand.
|
||||||
$this->session->driver($configuredDriver);
|
$this->session->driver($configuredDriver);
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException) {
|
||||||
// An exception is thrown if the configured driver is not a valid driver.
|
// An exception is thrown if the configured driver is not a valid driver.
|
||||||
// So we fallback to the default driver.
|
// So we fallback to the default driver.
|
||||||
$driver = $defaultDriver;
|
$driver = $defaultDriver;
|
||||||
|
|
|
@ -77,7 +77,7 @@ class AvatarValidator extends AbstractValidator
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->imageManager->make($file->getStream()->getMetadata('uri'));
|
$this->imageManager->make($file->getStream()->getMetadata('uri'));
|
||||||
} catch (NotReadableException $_e) {
|
} catch (NotReadableException) {
|
||||||
$this->raise('image');
|
$this->raise('image');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ class SessionManager extends IlluminateSessionManager
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$driverInstance = parent::driver($driverName);
|
$driverInstance = parent::driver($driverName);
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException) {
|
||||||
$defaultDriverName = $this->getDefaultDriver();
|
$defaultDriverName = $this->getDefaultDriver();
|
||||||
$driverInstance = parent::driver($defaultDriverName);
|
$driverInstance = parent::driver($defaultDriverName);
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ class SimpleFlarumSearchTest extends TestCase
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->app()->getContainer()->make(CustomSearcher::class);
|
$this->app()->getContainer()->make(CustomSearcher::class);
|
||||||
} catch (BindingResolutionException $e) {
|
} catch (BindingResolutionException) {
|
||||||
$anExceptionWasThrown = true;
|
$anExceptionWasThrown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ class ConfigTest extends TestCase
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$config['custom_a'] = 'c';
|
$config['custom_a'] = 'c';
|
||||||
} catch (RuntimeException $_) {
|
} catch (RuntimeException) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the value was not changed
|
// Ensure the value was not changed
|
||||||
|
@ -146,7 +146,7 @@ class ConfigTest extends TestCase
|
||||||
|
|
||||||
try {
|
try {
|
||||||
unset($config['custom_a']);
|
unset($config['custom_a']);
|
||||||
} catch (RuntimeException $_) {
|
} catch (RuntimeException) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the value was not changed
|
// Ensure the value was not changed
|
||||||
|
|
Loading…
Reference in New Issue
Block a user