Skip to content

Commit

Permalink
Init strict_types=1
Browse files Browse the repository at this point in the history
  • Loading branch information
s-damian committed Mar 3, 2024
1 parent 201b3a0 commit 3136618
Show file tree
Hide file tree
Showing 150 changed files with 328 additions and 16 deletions.
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\AppContracts\Http\Controllers\Error;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Auth/Auth.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Auth;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Auth/IsConnected.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Auth;

use DamianPhp\Support\Facades\Cookie;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Cache/Cache.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Cache;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Config/Config.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Config;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Config/Lang.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Config;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Config/SingletonConfig.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Config;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Auth/AuthInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Auth;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Auth/IsConnectedInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Auth;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Cache/CacheInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Cache;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Config/SingletonConfigInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Config;

/**
Expand Down
6 changes: 4 additions & 2 deletions src/DamianPhp/Contracts/Database/BaseModelInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Database;

use DamianPhp\Pagination\Pagination;
Expand Down Expand Up @@ -199,9 +201,9 @@ public function create(array $data): void;
public function update(array $data): void;

/**
* @return int - Dernier ID inséré par auto-incrémentation.
* @return int|string|false - Dernier ID inséré par auto-incrémentation.
*/
public function getLastInsertId(): int;
public function getLastInsertId(): int|string|false;

/**
* Pour les requetes SQL DELETE - Supprimer ligne(s) dans une table.
Expand Down
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Database\Connectors;

use PDO;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Date/DateInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Date;

/**
Expand Down
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Filesystem/FileInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Filesystem;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Form/FormInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Form;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Foundation/ApplicationInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Foundation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Hashing/HashInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Hashing;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Http/Request/CookieInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Http\Request;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Http/Request/InputInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Http\Request;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Http/Request/RequestInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Http\Request;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Http/Request/ServerInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Http\Request;

/**
Expand Down
4 changes: 3 additions & 1 deletion src/DamianPhp/Contracts/Http/Response/ResponseInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Http\Response;

/**
Expand All @@ -12,7 +14,7 @@ interface ResponseInterface
/**
* @param int - Code de la réponse HTTP.
*/
public function getHttpResponseCode(): int;
public function getHttpResponseCode(): int|bool;

/**
* Spécifier l'en-tête HTTP de l'affichage d'une vue.
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Log/LogInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Log;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Mail/MailerInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Mail;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Pagination/PaginationInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Pagination;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Routing/RouterInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Routing;

use DamianPhp\Routing\Route;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Security/TokenInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Security;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Session/FlashInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Session;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Session/SessionInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Session;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/String/SlugInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\String;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Contracts/Validation/ValidatorInterface.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Contracts\Validation;

use DamianPhp\Validation\Message;
Expand Down
8 changes: 5 additions & 3 deletions src/DamianPhp/Database/BaseModel.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database;

use PDO;
Expand Down Expand Up @@ -568,7 +570,7 @@ private function aggregation(string $aggregation): float|int

$this->query->close();

return $result->nb;
return is_string($result->nb) ? (float) $result->nb : $result->nb;
}

/**
Expand Down Expand Up @@ -649,9 +651,9 @@ final public function update(array $data): void
}

/**
* @return int - Dernier ID inséré par auto-incrémentation.
* @return int|string|false - Dernier ID inséré par auto-incrémentation.
*/
final public function getLastInsertId(): int
final public function getLastInsertId(): int|string|false
{
return (int) $this->query->getLastInsertId();
}
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Collection.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database;

use DamianPhp\Contracts\Database\BaseModelInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Connectors/Connector.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database\Connectors;

use PDO;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Connectors/MySQL.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database\Connectors;

use PDO;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Connectors/PostgreSQL.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database\Connectors;

use DamianPhp\Support\Helper;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Paginated.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database;

use DamianPhp\Pagination\Pagination;
Expand Down
6 changes: 4 additions & 2 deletions src/DamianPhp/Database/Query.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database;

use PDO;
Expand Down Expand Up @@ -722,9 +724,9 @@ public function setRowCount(bool $runRowCount): ?int
}

/**
* @return int - Dernier ID inséré par auto-incrémentation.
* @return int|string|false - Dernier ID inséré par auto-incrémentation.
*/
public function getLastInsertId(): int
public function getLastInsertId(): int|string|false
{
return $this->getConnection()->lastInsertId();
}
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Related.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database;

use PDO;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Relations/BelongsToMany.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database\Relations;

use DamianPhp\Contracts\Database\BaseModelInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/DamianPhp/Database/Relations/HasMany.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace DamianPhp\Database\Relations;

use DamianPhp\Contracts\Database\BaseModelInterface;
Expand Down

0 comments on commit 3136618

Please sign in to comment.