Updated documentation + started to add some documentation
continuous-integration/drone/push Build is passing Details

pull/16/head
Maël DAIM 1 year ago
parent d824f17ea7
commit 1b9a873cdc

@ -12,12 +12,14 @@ class Team {
}
Team --> "- mainColor" Color
Team --> "- secondaryColor" Color
Team --> "- secondColor" Color
class Color {
- value: int
+ getValue(): int
- value: string
- __construct(value : string)
+ getValue(): string
+ from(value: string): Color
+ tryFrom(value : string) : ?Color
}
class TeamGateway{
@ -31,15 +33,11 @@ TeamGateway *--"- con" Connexion
TeamGateway ..> Color
class TeamModel{
+ ERROR_INVALID_COLOR : int {readOnly}
+ ERROR_INVALID_NAME : int {readOnly}
+ ERROR_INVALID_PICTURE : int {readOnly}
+ ERROR_INVALID_SEARCH : int {readOnly}
+ ERROR_NO_DATA_FOUND : int {readOnly}
---
+ __construct(gateway : TeamGateway)
+ createTeam(name : string,picture : string, mainColorValue : int, secondColorValue : int, errors : array)
+ listByName(name : string ,errors : array) : ?array
+ displayTeam(id : int): Team
}
TeamModel *--"- gateway" TeamGateway
@ -50,8 +48,11 @@ class TeamController{
- twig : Environement
--
+ __construct( model : TeamModel, twig : Environement)
+ submitTeam(request : array)
+ listTeamByName(request : array)
+ displaySubmitTeam() : HttpResponse
+ submitTeam(request : array) : HttpResponse
+ displayListTeamByName(): HttpResponse
+ listTeamByName(request : array) : HttpResponse
+ displayTeam(id : int): HttpResponse
}
TeamController *--"- model" TeamModel
@ -62,7 +63,6 @@ class Connexion{
+ __constructor(pdo : PDO)
+ exec(query : string, args : array)
+ fetch(query string, args array): array
}
@enduml

@ -10,7 +10,7 @@ use App\Validation\FieldValidationFail;
use App\Validation\Validators;
use \Twig\Environment;
class TeamController /* verif si les camp sont assignés, sinon erreur 400*/
class TeamController
{
private TeamModel $model;
private Environment $twig;
@ -24,7 +24,7 @@ class TeamController /* verif si les camp sont assignés, sinon erreur 400*/
$this->twig = $twig;
}
public function displaySubmitTeam() {
public function displaySubmitTeam() : HttpResponse {
return ViewHttpResponse::twig("insert_team.html.twig", []);
}

@ -4,6 +4,16 @@
<meta charset="UTF-8">
<title>Twig view</title>
<style>
body{
background-color: #f1f1f1;
display: flex;
flex-direction: column;
}
section{
width: 80%;
}
.square{
width:50px;
height:50px;
@ -15,10 +25,24 @@
#secondColor{
background-color: {{ team.secondColor.getValue() }};
}
.container{
background-color: #fff;
}
.team{
border-color: darkgrey;
border-radius: 20px;
}
</style>
</head>
<body>
<header>
<h1><a href="/">IQBall</a></h1>
</header>
<section class="container">
<div class="team">
<h1>{{ team.name }}</h1>
<img src="{{ team.picture }}" alt="Logo d'équipe">
<div class="square" id="mainColor"></div>
@ -27,6 +51,8 @@
{% for m in team.members %}
<p> m.id </p>
{% endfor %}
</div>
</section>
</body>
</html>
Loading…
Cancel
Save