0

I was installing the script and getting the following error in the code,

Fatal error: Can't use method return value in write context in /home4/michael/hashmagic.co/app/src/App/App.php on line 263

the line 263 of code is shown below,

public function _creditCardEnabled(){
    if(is_null($this->_getPrivateStripeKey()) || empty($this->_getPrivateStripeKey())) return false;
    return intval($this->_getSettingsAttribute('creditcard_enabled')) == 1;
  }

kindly tell me what to write instead of the code I shown.

Poorna Senani Gamage
  • 1,246
  • 2
  • 19
  • 30
Zain Azeem
  • 19
  • 1
  • 6
  • first assign `$this->_getPrivateStripeKey()` and `$this->_getSettingsAttribute` to a variable and then use that variable in your conditional statements – sietse85 Apr 14 '18 at 13:59
  • lol @IncredibleHat was just reading that ;) But i am right he needs to put his function returns in a var first and then use that in conditional statements – sietse85 Apr 14 '18 at 14:01
  • Well, yes you are right ;) But its just a duplicate question too. The issue is his 'empty' in either case heh. – IncredibleHat Apr 14 '18 at 14:01
  • @sietse85 thank you so much, i have stored the $this->_getPrivateStripeKey() in variable, that works, thanks :) – Zain Azeem Apr 14 '18 at 14:10

0 Answers0