Skip to content

Commit

Permalink
[Action][php-cs-fixer] Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
EthannSchneider authored and github-actions[bot] committed Nov 29, 2024
1 parent e0dcb04 commit 9bcb546
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 74 deletions.
3 changes: 2 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
* @description entry point of the application
* @description entry point of the application
*/

session_start();
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/error.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand Down Expand Up @@ -54,7 +55,7 @@ function unauthorized($return_code = 401, $error_message = 'Unauthorized')
}

/**
* send a 500 error code with a Server Error
* send a 500 error code with a Server Error
*
* @param int $return_code
* @param string $error_message
Expand Down
9 changes: 5 additions & 4 deletions src/controllers/exercise_controller.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
* @description This file is for the excercise controller without the view
* @description This file is for the excercise controller without the view
*/

include_once MODEL_DIR . '/exercise.php';
Expand All @@ -11,7 +12,7 @@
* ExerciseController
*/
class ExerciseController
{
{
/**
* create an exercise
*
Expand All @@ -27,7 +28,7 @@ public function createExercise()
$exercise = Exercise::create($_POST['exercise_title']);
header('Location: /exercises/' . $exercise->getId() . '/fields');
}

/**
* Delete an exercise
*
Expand All @@ -43,7 +44,7 @@ public function deleteExercise(int $id)
}
header('Location: /exercises');
}

/**
* Change state of an exercise
*
Expand Down
11 changes: 6 additions & 5 deletions src/controllers/field_controller.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
* @description This file is for the field controller without the View
* @description This file is for the field controller without the View
*/

require_once MODEL_DIR . '/exercise.php';
Expand All @@ -11,7 +12,7 @@
* FieldController
*/
class FieldController
{
{
/**
* create a field
*
Expand All @@ -35,7 +36,7 @@ public function createField(int $exercise_id)

header('Location: /exercises/' . $exercise_id . '/fields');
}

/**
* delete a field
*
Expand All @@ -56,7 +57,7 @@ public function deleteField(int $exercise_id, int $field_id)

header('Location: /exercises/' . $exercise_id . '/fields');
}

/**
* edit a field
*
Expand Down Expand Up @@ -84,7 +85,7 @@ public function editField(int $exercise_id, int $field_id)

header('Location: /exercises/' . $exercise_id . '/fields/' . $field_id . '/edit');
}

/**
* kindStringToKindEnum
*
Expand Down
7 changes: 4 additions & 3 deletions src/controllers/fulfillment_controller.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
* @description This file is for the fulfillment controller without the View
* @description This file is for the fulfillment controller without the View
*/

include_once MODEL_DIR . '/exercise.php';
Expand All @@ -11,7 +12,7 @@
* FulfillmentController
*/
class FulfillmentController
{
{
/**
* create a fulfillment
*
Expand Down Expand Up @@ -47,7 +48,7 @@ public function createFulfillment(int $exercise_id)

header('Location: /exercises/' . $exercise->getId() . '/fulfillments/' . $fulfillment->getId() . '/edit');
}

/**
* edit a fulfillment
*
Expand Down
23 changes: 12 additions & 11 deletions src/controllers/navigation.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand All @@ -11,7 +12,7 @@
* Navigation controller to get the GUI
*/
class Navigation
{
{
/**
* home page
*
Expand All @@ -21,7 +22,7 @@ public function home()
{
include VIEW_DIR . '/home.php';
}

/**
* create an exercises page
*
Expand All @@ -31,7 +32,7 @@ public function createAnExercises()
{
include VIEW_DIR . '/create_an_exercise.php';
}

/**
* take an exercises page
*
Expand All @@ -42,7 +43,7 @@ public function takeAnExercises()
$exercises = Exercise::getExercises(Status::Answering);
include VIEW_DIR . '/take_an_exercise.php';
}

/**
* manage an exercises
*
Expand All @@ -56,7 +57,7 @@ public function manageExercises()

include VIEW_DIR . '/manage_an_exercise.php';
}

/**
* manage a field page
*
Expand All @@ -75,7 +76,7 @@ public function manageField(int $id)

include VIEW_DIR . '/manage_field.php';
}

/**
// * edit a Field page
*
Expand All @@ -100,7 +101,7 @@ public function editAField(int $exercise_id, int $id)

include VIEW_DIR . '/edit_a_field.php';
}

/**
* take page is the page to answer exercise
*
Expand All @@ -121,7 +122,7 @@ public function take(int $exercise_id)

include VIEW_DIR . '/take.php';
}

/**
* show results of an exerise
*
Expand All @@ -133,7 +134,7 @@ public function showResults(int $id)
$exercise = new Exercise($id);
include VIEW_DIR . '/show_exercise_results.php';
}

/**
* show field results
*
Expand All @@ -153,7 +154,7 @@ public function showFieldResults(int $exercise_id, int $field_id)

include VIEW_DIR . '/show_field_results.php';
}

/**
* show fulfillment results
*
Expand All @@ -174,7 +175,7 @@ public function showFulfillmentResults(int $exercise_id, int $fulfillment_id): v

include VIEW_DIR . '/show_fulfillment_results.php';
}

/**
* edit a fullfillment
*
Expand Down
1 change: 1 addition & 0 deletions src/models/databases_connectors/databases_access.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand Down
7 changes: 4 additions & 3 deletions src/models/databases_connectors/databases_choose.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand All @@ -15,10 +16,10 @@ class DatabasesChoose
// static for now but should be in a dynamic config
private string $databases = 'postgresql';
private static DatabasesAccess $database;

/**
* DatabasesChoose contructor
*
*
* @return void
*/
public function __construct()
Expand All @@ -31,7 +32,7 @@ public function __construct()
self::$database = new PostgresqlAccess('postgresql', 5432, 'db_looper', $_ENV['POSTGRES_USER'], $_ENV['POSTGRES_PASSWORD']);
}
}

/**
* get dataases access implement with the correct databases
*
Expand Down
5 changes: 3 additions & 2 deletions src/models/databases_connectors/postgresql/postgresql.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand All @@ -12,7 +13,7 @@ public function __construct($host, $port, $dbname, $postgres_user, $postgres_pas
{
$this->db = new PDO('pgsql:host=' . $host . ';port=' . $port . ';dbname=' . $dbname, $postgres_user, $postgres_password);
}

/**
* select (all select, returning at the end of an insert) basicly all that is returning somethings
*
Expand All @@ -32,7 +33,7 @@ public function select(string $squery, array $args = [])

return $statement->fetchAll();
}

/**
* modify (insert, update) basicly all that isn't returning anything
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand Down
9 changes: 5 additions & 4 deletions src/models/exceptions/looper_exception.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Ethann Schneider, Guillaume Aubert, Jomana Kaempf
* @version 29.11.2024
Expand All @@ -9,14 +10,14 @@ class LooperException extends Exception
{
private int $httpReturnCode = 0;
private string $httpErrorMessage = '';

/**
* __construct
*
* @param int $httpReturnCode http error code
* @param string $httpErrorMessage http error message
* @param string $message error message
* @param int $code erro code
* @param int $code erro code
* @param Exception $previous last exception throwed
* @return void
*/
Expand All @@ -26,7 +27,7 @@ public function __construct(int $httpReturnCode, string $httpErrorMessage, $mess
$this->httpReturnCode = $httpReturnCode;
$this->httpErrorMessage = $httpErrorMessage;
}

/**
* get http return code
*
Expand All @@ -36,7 +37,7 @@ public function getReturnCode(): int
{
return $this->httpReturnCode;
}

/**
* get http error message
*
Expand Down
Loading

0 comments on commit 9bcb546

Please sign in to comment.