Welcome Guest, Not a member yet? Register   Sign In
return value of settings helper call?
#6

(09-22-2023, 08:50 PM)kenjis Wrote: It is the return type of the setting() function.

My previous post refers the Settings->set() or service('settings')->set() method

returning void feels weird. Wouldn't it be clean to do:

```
if ( !setting()->set('mykey','myval') ){
//handle failĀ 
}
```
With a void return, that can eval as null, you have to use is_null() to get the boolean. Seems roundabout when the convention set by most php core functions like this is to return false on fail.

Am I missing something?
Reply


Messages In This Thread
RE: return value of settings helper call? - by evansharp - 09-22-2023, 09:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB