psr
This commit is contained in:
parent
a74feab37e
commit
64cbb94829
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @return PDO Une instance PDO
|
||||
*/
|
||||
function getDatabaseConnection()
|
||||
function getDatabaseConnection()
|
||||
{
|
||||
static $pdo;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue