Running ./bin/repository move-paths without specifying --from nor --to
leads to the PHP 8 error about strlen() not accepting null parameters.
Details
Details
- Reviewers
speck valerio.bozzolan - Group Reviewers
O1: Blessed Committers - Commits
- rPa7fb04f96c92: fix PHP 8 "strlen(null)" when moving paths with missing options
Running ./bin/repository move-paths without --from/--to (shows a proper error)
Diff Detail
Diff Detail
- Repository
- rP Phorge
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
This seems fine, though I wonder if we should introduce a phutil_empty_string() or phutil_is_empty_string function to avoid the double-negative logic. I think this reads more easily:
if (phutil_empty_string($from)) { throw new Exception() }
than this:
if (!phutil_nonempty_string($from)) { throw new Exception() }
Comment Actions
In the future it may be nice to also have a getArgStr() that always return a string, never NULL. So, we can just if ( $to === '' )