My review will be short is longer than I expected but I will only focus on the function userDatauseData()
.
I don't think that userDatauseData
is a good name.
I strongly recommend to change it to lowercase_and_underscore
(a.k.a. snake_case
).
Why is that? If you write userdatausedata
by mistake, you will have an hard time to look into "Where in the living fudge is this declared???"
just to notice that you have misspelled the name of the function and that PHP doesn't care about casing in the function name.
If you write USER_DATAUSE_DATA
, User_DataUse_Data
or any variation, it is easier to find the name. Implicitly you split the name by the _
and compare part by part.
Try this experiment:
But, even if you change the name to user_datause_data
, it will be a bad name.
Why is that? Well, the name gives the idea that you are trying to get the useruse some data to do something. But youwhat is it doing? I don't evenknow, I have a single return!to read the whole function to know.