tron-api icon indicating copy to clipboard operation
tron-api copied to clipboard

Make functions from TronAwareTrait - static

Open 1099511627776 opened this issue 6 years ago • 1 comments

I suggest you to convert functions like fromTron, toTron, fromHex, toHex etc to static as thay do not use Tron object internal state and should be called without instantiating whole tron object.

If you are afraid of braking api compatibility then you should do this in 4 steps.

  1. Make static copies of those functions
  2. Make non static functions to use static ones
  3. Declare non-static functions as deprecated
  4. After some time - remove non-static functions from trait

1099511627776 avatar Nov 19 '19 11:11 1099511627776

https://github.com/iexbase/tron-api/blob/master/src/Tron.php#L138

serderovsh avatar Nov 19 '19 18:11 serderovsh