diff --git a/sql/database.php b/sql/database.php index 6684235..6d20c56 100644 --- a/sql/database.php +++ b/sql/database.php @@ -30,4 +30,3 @@ function get_database(): PDO { return $pdo; } - diff --git a/src/Api/API.php b/src/Api/API.php index 2d5e8b3..3437536 100644 --- a/src/Api/API.php +++ b/src/Api/API.php @@ -26,8 +26,6 @@ class API { header('Content-type: application/json'); echo $response->getJson(); } elseif (get_class($response) != HttpResponse::class) { - var_dump($response); - var_dump(get_class($response)); throw new Exception("API returned unknown Http Response"); } } diff --git a/src/Api/Controller/APITeamController.php b/src/Api/Controller/APITeamController.php index 1d4fa87..270468d 100644 --- a/src/Api/Controller/APITeamController.php +++ b/src/Api/Controller/APITeamController.php @@ -15,7 +15,6 @@ use IQBall\Core\Model\TeamModel; use IQBall\Core\Validation\DefaultValidators; class APITeamController { - private TeamModel $teamModel; /** @@ -64,14 +63,14 @@ class APITeamController { }); } - public function updateTeam(int $id):HttpResponse{ + public function updateTeam(int $id): HttpResponse { return APIControl::runChecked([ 'name' => [DefaultValidators::name()], 'picture' => [DefaultValidators::isURL()], 'mainColor' => [DefaultValidators::hexColor()], 'secondaryColor' => [DefaultValidators::hexColor()], - ], function (HttpRequest $req){ - $this->teamModel->editTeam($req['id'],$req['name'], $req['picture'], $req['mainColor'], $req['secondaryColor']); + ], function (HttpRequest $req) { + $this->teamModel->editTeam($req['id'], $req['name'], $req['picture'], $req['mainColor'], $req['secondaryColor']); return HttpResponse::fromCode(HttpCodes::OK); }); } diff --git a/src/Core/Control.php b/src/Core/Control.php index a8ac6c6..51d6622 100644 --- a/src/Core/Control.php +++ b/src/Core/Control.php @@ -15,7 +15,6 @@ class Control { * @param array $schema an array of `fieldName => DefaultValidators` which represents the request object schema * @param callable(HttpRequest): HttpResponse $run the callback to run if the request is valid according to the given schema. * The callback must accept an HttpRequest, and return an HttpResponse object. -<<<<<<< HEAD:src/Core/Control.php * @param ControlSchemaErrorResponseFactory $errorFactory an error factory to use if the request does not validate the required schema * @return HttpResponse */