Optimise tests and coverage.

This commit is contained in:
James Cole
2018-05-13 09:01:10 +02:00
parent 528da3f08e
commit 1aae84a4d0
13 changed files with 154 additions and 106 deletions

View File

@@ -40,14 +40,8 @@ class ImportProvider implements BinderInterface
*/
public static function routeBinder(string $value, Route $route): string
{
$providers = (array)config('import.enabled');
$allowed = [];
foreach ($providers as $name => $enabled) {
if ($enabled || (bool)config('app.debug') === true) {
$allowed[] = $name;
}
}
if (\in_array($value, $allowed, true)) {
$providers = array_keys((array)config('import.enabled'));
if (\in_array($value, $providers, true)) {
return $value;
}
throw new NotFoundHttpException;