Various code cleanup.

This commit is contained in:
James Cole
2018-07-27 05:03:37 +02:00
parent 0312ba8ad7
commit e3e0e12fef
43 changed files with 167 additions and 145 deletions

View File

@@ -27,30 +27,14 @@ use FireflyIII\Import\Prerequisites\PrerequisitesInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Illuminate\Routing\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class ImportProvider.
*/
class ImportProvider implements BinderInterface
{
/**
* @param string $value
* @param Route $route
*
* @return Carbon
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public static function routeBinder(string $value, Route $route): string
{
$providers = array_keys(self::getProviders());
if (\in_array($value, $providers, true)) {
return $value;
}
throw new NotFoundHttpException;
}
/**
* @return array
*/
@@ -99,4 +83,20 @@ class ImportProvider implements BinderInterface
return $providers;
}
/**
* @param string $value
* @param Route $route
*
* @return Carbon
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
public static function routeBinder(string $value, Route $route): string
{
$providers = array_keys(self::getProviders());
if (\in_array($value, $providers, true)) {
return $value;
}
throw new NotFoundHttpException;
}
}