Simplify the getting of state values

Created on 11 August 2023, 11 months ago

We can simplify how we retrieve the state value. Instead of using $payment->getState()->getValue()['value'], why not use $payment->getState()->getId()?

For clarification, the getState method returns an object that implements the StateItemInterface. This interface is, in turn, implemented by the StateItem class, which possesses the getId method. This method essentially achieves what the current module does but in a more straightforward manner. I hope this clarifies things.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine taraskorpach Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024