1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 03:32:42 +01:00
phorge-phorge/src/applications/repository/engine
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
..
__tests__ Further correct and disambigutate ref selectors passed to Git on the CLI 2021-01-20 12:07:14 -08:00
PhabricatorRepositoryCommitRef.php Rename "IMPORTED_CLOSEABLE" to "IMPORTED_PERMANENT" to clarify the meaning of the flag 2021-01-22 19:51:38 -08:00
PhabricatorRepositoryDiscoveryEngine.php Add support to marking commits as UNREACHABLE for Mercurial 2021-09-04 19:05:08 -04:00
PhabricatorRepositoryEngine.php Internally, align commit processing tasks around PHIDs, not IDs 2021-02-02 13:40:10 -08:00
PhabricatorRepositoryIdentityEditEngine.php Assign RepositoryIdentity objects to commits 2018-05-31 07:28:23 -07:00
PhabricatorRepositoryMirrorEngine.php Remove product literal strings in "pht()", part 8 2022-04-25 12:22:29 -07:00
PhabricatorRepositoryPullEngine.php PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
PhabricatorRepositoryRefEngine.php Internally, align commit processing tasks around PHIDs, not IDs 2021-02-02 13:40:10 -08:00