refactor: code style changes

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2023-01-15 00:04:00 +00:00
parent 25155bff2e
commit 3727c84f3e
146 changed files with 1013 additions and 1341 deletions

View File

@@ -25,14 +25,14 @@ use App\Exceptions\EmptyFormException;
use App\Exceptions\FormHasConstraintsException;
use App\Form;
use App\Services\FormManagementService;
use ContextAwareValidator;
use Illuminate\Http\Request;
class FormController extends Controller
{
private $formService;
public function __construct(FormManagementService $formService) {
public function __construct(FormManagementService $formService)
{
$this->formService = $formService;
}
@@ -56,17 +56,14 @@ class FormController extends Controller
{
try {
$form = $this->formService->addForm($request->all());
}
catch (EmptyFormException $ex)
{
} catch (EmptyFormException $ex) {
return redirect()
->back()
->with('exception', $ex->getMessage());
}
// Form is boolean or array
if ($form)
{
if ($form) {
return redirect()
->back()
->with('success', __('Form created!'));
@@ -81,18 +78,15 @@ class FormController extends Controller
{
$this->authorize('delete', $form);
try {
$this->formService->deleteForm($form);
return redirect()
->back()
->with('success', __('Form deleted successfuly'));
} catch (FormHasConstraintsException $ex) {
return redirect()
->back()
->with('error', $ex->getMessage());
}
}