Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 Deprecation? #314

Open
andrewteg opened this issue Jan 26, 2025 · 1 comment
Open

PHP 8.4 Deprecation? #314

andrewteg opened this issue Jan 26, 2025 · 1 comment

Comments

@andrewteg
Copy link

andrewteg commented Jan 26, 2025

I get the following when testing a pretty basic setup on PHP 8.4.3. It looks like it's this deprecation (https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) and I'm wondering if there's a roadmap to make this PHP 8.4 compatible, or if I've done something wrong. Thanks.

Deprecated: Delight\Db\PdoDatabase::__construct(): Implicitly marking parameter $pdoInstance as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 49

Deprecated: Delight\Db\PdoDatabase::__construct(): Implicitly marking parameter $pdoDsn as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 49

Deprecated: Delight\Db\PdoDatabase::select(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 117

Deprecated: Delight\Db\PdoDatabase::selectValue(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 124

Deprecated: Delight\Db\PdoDatabase::selectRow(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 131

Deprecated: Delight\Db\PdoDatabase::selectColumn(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 138

Deprecated: Delight\Db\PdoDatabase::exec(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 246

Deprecated: Delight\Db\PdoDatabase::setProfiler(): Implicitly marking parameter $profiler as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 364

Deprecated: Delight\Db\PdoDatabase::configureConnection(): Implicitly marking parameter $newAttributes as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 514

Deprecated: Delight\Db\PdoDatabase::configureConnection(): Implicitly marking parameter $oldAttributes as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 514

Deprecated: Delight\Db\PdoDatabase::selectInternal(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\PdoDatabase.php on line 567

Deprecated: Delight\Db\Database::select(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 31

Deprecated: Delight\Db\Database::selectValue(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 44

Deprecated: Delight\Db\Database::selectRow(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 57

Deprecated: Delight\Db\Database::selectColumn(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 70

Deprecated: Delight\Db\Database::exec(): Implicitly marking parameter $bindValues as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 117

Deprecated: Delight\Db\Database::setProfiler(): Implicitly marking parameter $profiler as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\db\src\Database.php on line 183

Deprecated: Delight\Auth\Auth::register(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\Auth.php on line 228

Deprecated: Delight\Auth\Auth::registerWithUniqueUsername(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\Auth.php on line 269

Deprecated: Delight\Auth\Auth::login(): Implicitly marking parameter $onBeforeSuccess as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\Auth.php on line 294

Deprecated: Delight\Auth\Auth::loginWithUsername(): Implicitly marking parameter $onBeforeSuccess as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\Auth.php on line 319

Deprecated: Delight\Auth\Auth::authenticateUserInternal(): Implicitly marking parameter $onBeforeSuccess as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\Auth.php on line 1035

Deprecated: Delight\Auth\UserManager::createUserInternal(): Implicitly marking parameter $callback as nullable is deprecated, the explicit nullable type must be used instead in \php-auth\vendor\delight-im\auth\src\UserManager.php on line 125

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in \php-auth\vendor\delight-im\auth\src\Auth.php on line 61

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in \php-auth\vendor\delight-im\auth\src\Auth.php on line 63

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in \php-auth\vendor\delight-im\auth\src\Auth.php on line 65

@ocram
Copy link
Contributor

ocram commented Feb 27, 2025

Thanks!

Yes, the fix is very easy. But unfortunately, we still have to support PHP 7.0, for example for clients on Ubuntu with Ubuntu Expanded Security Maintenance (ESM).

In production, you should obviously disable deprecation warnings. But for development environments, our only choice right now may be to drop the type annotations (turning SomeClass $someParam = null into just $someParam = null) to get rid of the implicit null in the annotation, until we can drop PHP 7.0 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants