The API for most php structs works like this (method as example, but also for properties, constants, etc... you name it):
setMethod($method)
getMethod($nameOrMethod)
removeMethod($nameOrMethod)
getMethods()
setMethods()
while setMethod() is technically the correct name, adding is the action we have in mind. Although, sometimes getMethods() returns different value types. Sometimes that is ok (depending on the type we want to fetch) but most times there should be better method names for such tasks, e.g. getMethodNames().
There is time to work through this API, identify similar patterns and make the API consistent.
The API for most php structs works like this (method as example, but also for properties, constants, etc... you name it):
setMethod($method)getMethod($nameOrMethod)removeMethod($nameOrMethod)getMethods()setMethods()while
setMethod()is technically the correct name, adding is the action we have in mind. Although, sometimesgetMethods()returns different value types. Sometimes that is ok (depending on the type we want to fetch) but most times there should be better method names for such tasks, e.g.getMethodNames().There is time to work through this API, identify similar patterns and make the API consistent.