1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 19:22:42 +01:00
phorge-phorge/src/applications/repository
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
..
codex When destorying a repository, print a notification about removing the working copy 2017-08-01 08:57:39 -07:00
conduit Update Diffusion conduit text 2017-07-02 14:25:10 +00:00
config Remove product literal strings in "pht()", part 22 2022-04-25 16:46:26 -07:00
constants Simplify Create Repository page 2017-08-15 11:05:50 -07:00
customfield Move various other callsites away from callsigns 2016-01-04 06:54:42 -08:00
daemon Add support to marking commits as UNREACHABLE for Mercurial 2021-09-04 19:05:08 -04:00
data Collapse repository URI normalization code into Arcanist 2020-06-30 15:54:33 -07:00
editor Modularize Repository transactions 2018-11-28 14:29:18 -08:00
engine PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
graphcache Bail out of PhabricatorRepositoryGraphCache more aggressively after cache fills 2017-10-06 14:12:58 -07:00
mail Build separate mail for each recipient, honoring recipient access levels 2015-06-03 18:59:31 -07:00
management Remove product literal strings in "pht()", part 8 2022-04-25 12:22:29 -07:00
phid Remove "State Icons" from handles 2019-10-31 12:04:43 -07:00
query Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
response Return Git HTTP error messages in an HTTP header 2021-01-26 16:14:03 -08:00
search Add controllers/search/edit engine functionality to RepositoryIdentity 2018-05-31 07:03:25 -07:00
storage PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
worker Internally, align commit processing tasks around PHIDs, not IDs 2021-02-02 13:40:10 -08:00
xaction Remove product literal strings in "pht()", part 23 2022-04-25 16:46:26 -07:00