From 64cbb948298d373564404fc1560f5c444d5c4468 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 4 Feb 2016 19:59:27 +0100 Subject: [PATCH] psr --- lib/database.php | 2 +- lib/project.php | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/database.php b/lib/database.php index 28625ab..333a0ec 100644 --- a/lib/database.php +++ b/lib/database.php @@ -3,7 +3,7 @@ /** * @return PDO Une instance PDO */ -function getDatabaseConnection() +function getDatabaseConnection() { static $pdo; diff --git a/lib/project.php b/lib/project.php index 87d170a..b6cac57 100644 --- a/lib/project.php +++ b/lib/project.php @@ -94,9 +94,9 @@ function getCommentsByProject($id) * @param string $website Site web de l'auteur * @param string $content Contenu du commentaire * @param DateTime $date Date du commentaire - * @param int $projectId L'id du projet associé + * @param int $projectId L'id du projet associé */ -function createComment($name, $email, $website, $content, DateTime $date, $projectId) +function createComment($name, $email, $website, $content, DateTime $date, $projectId) { $pdo = getDatabaseConnection(); @@ -122,12 +122,12 @@ function createComment($name, $email, $website, $content, DateTime $date, $proje * @param int $numberOfPages Le nombre de pages * @return array Les pages */ -function getProjectsPager($page, $numberOfPages) +function getProjectsPager($page, $numberOfPages) { if (!is_integer($page)) { throw new InvalidArgumentException('The argument "page" must be an integer.'); } - + if (!is_integer($numberOfPages)) { throw new InvalidArgumentException('The argument "numberOfPages" must be an integer.'); } @@ -141,7 +141,7 @@ function getProjectsPager($page, $numberOfPages) 'current' => $page === 1, ); } - + if ($page > 1) { $pages[] = array( 'title' => 'Précédent', @@ -159,7 +159,7 @@ function getProjectsPager($page, $numberOfPages) ); } } - + if ($page < $numberOfPages) { $pages[] = array( 'title' => 'Suivant', @@ -178,7 +178,3 @@ function getProjectsPager($page, $numberOfPages) return $pages; } - - - -