Formatted with php-cs-fixer

This commit is contained in:
julien
2026-03-08 22:47:10 +01:00
parent ee559a7a4e
commit 8d7aba5447
6 changed files with 30 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/* -------------------------------------------------

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
use RedBeanPHP\R;

View File

@@ -1,2 +1,3 @@
<?php
// Non utilisé pour l'instant

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace App\Models;
@@ -9,7 +10,7 @@ use RedBeanPHP\OODBBean;
/**
* Modèle RedBeanPHP minimal pour l'entité «post».
*
* Chaque instance encapsule un bean RedBean (`OODBBean`).
* Chaque instance encapsule un bean RedBean (`OODBBean`).
* Les opérations CRUD sont déléguées à RedBean, tandis que les
* getters/setters offrent une API typée.
*/
@@ -51,7 +52,7 @@ class Post
public static function allDesc(): array
{
$beans = R::findAll('post', ' ORDER BY id DESC ');
return array_map(fn(OODBBean $b) => new self($b), $beans);
return array_map(fn (OODBBean $b) => new self($b), $beans);
}
/* -------------------------------------------------
@@ -74,12 +75,27 @@ class Post
ACCESSEURS / MUTATEURS
------------------------------------------------- */
public function getId(): int { return (int) $this->bean->id; }
public function getTitle(): string { return (string) $this->bean->title; }
public function getContent(): string { return (string) $this->bean->content; }
public function getId(): int
{
return (int) $this->bean->id;
}
public function getTitle(): string
{
return (string) $this->bean->title;
}
public function getContent(): string
{
return (string) $this->bean->content;
}
public function setTitle(string $title): void { $this->bean->title = $title; }
public function setContent(string $content): void { $this->bean->content = $content; }
public function setTitle(string $title): void
{
$this->bean->title = $title;
}
public function setContent(string $content): void
{
$this->bean->content = $content;
}
/* -------------------------------------------------
MISE À JOUR À PARTIR D'UN TABLEAU

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
use Slim\App;

View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
use Slim\App;
@@ -12,6 +13,6 @@ use App\Controllers\PostController;
*/
return function (App $app): void {
// Page d'accueil liste des articles
$app->get('/', [PostController::class, 'index']);
// Page d'accueil liste des articles
$app->get('/', [PostController::class, 'index']);
};