Optimise tests and coverage.

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

No files matched your search

+2 -8
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;