1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-20 19:51:08 +01:00
phorge-phorge/src/infrastructure/log
Valerio Bozzolan d25d630fe5 PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1
Summary:
This change avoids some unnecessary uses of the strlen() function,
actually fixing some deprecation warnings in PHP 8.2.

In short, this is the suggested universal replace:

    -if(strlen($v))
    +if(phutil_nonempty_string($v))

And, if you know PHP, this is also another adoptable replace, but
only for cases where you are sure that the string "0" is not useful:

    -if(strlen($v))
    +if($v))

As usual the optimal solution depends on the contest.

Other similar patches will probably follow.

Closes T15222
Ref T15190

Test Plan:
- for the first time in my life, with this change, the unit tests are passed in PHP 8.2
- check with your big eyes that there are no obvious typos

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15199, T15190, T15222

Differential Revision: https://we.phorge.it/D25104
2023-03-31 22:05:52 +02:00
..
PhabricatorAccessLog.php Add "%I" (instance name) to application log formats 2017-04-23 11:07:19 -07:00
PhabricatorProtocolLog.php Proxy the "git upload-pack" wire protocol 2019-04-18 04:57:51 -07:00
PhabricatorSSHLog.php PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00