Chris Abbey on Nostr: Does anyone have a better way to write the conditional calls to foo at lines 5-9 of ...
Does anyone have a better way to write the conditional calls to foo at lines 5-9 of this #php code?
https://3v4l.org/fqCvv The goal is to have the default argument for bar trigger the default argument for foo, but they're different defaults (since one is nullable and the other isn't), and bar should not need to know what foo's default is. (obviously in my real code it's a much more complex signature, and separate classes.)
Published at
2024-04-18 00:23:43Event JSON
{
"id": "492e56049abe77efb16d475072b2ff4b21320d3845f9a3ba13e95b3bf9911c47",
"pubkey": "276b5f35f8893108e4febe4b60c85a0c002fde52c45d583c4b975c78a4632101",
"created_at": 1713399823,
"kind": 1,
"tags": [
[
"t",
"php"
],
[
"proxy",
"https://phpc.social/users/cabbey/statuses/112289370823474624",
"activitypub"
]
],
"content": "Does anyone have a better way to write the conditional calls to foo at lines 5-9 of this #php code? https://3v4l.org/fqCvv The goal is to have the default argument for bar trigger the default argument for foo, but they're different defaults (since one is nullable and the other isn't), and bar should not need to know what foo's default is. (obviously in my real code it's a much more complex signature, and separate classes.)",
"sig": "63acf1391ee68c827c7c451368fd0d3ea6131391b5da1e484381ee2f1f79c696fa4eba8bc190bda58f55258f202136452ae21b090ca300fb18271440b16bc82b"
}