148 reputation
6
bio website basereality.com
location Sydney, Australia
age 38
visits member for 1 year, 7 months
seen Jun 30 at 21:45

Coder, photographer, cake baker.


Feb
5
comment Changing method signature for implementing classes in PHP
No - You've missed the point of the question. You can't change function signature, or PHP gives the error "Declaration of WoodProcessor::bar() must be compatible with AbstractProcessor::bar(Item $item)"
Feb
5
comment Changing method signature for implementing classes in PHP
Yes - but it doesn't address the problem that i) the shared methods need to use the base class of 'Item' ii) The type specific methods want to use a sub-class "WoodItem" but that gives an error like "Declaration of WoodProcessor::bar() must be compatible with AbstractProcessor::bar(Item $item)"
Feb
5
comment Changing method signature for implementing classes in PHP
Because the two classes share 80% of their code, which is in the abstract class. Using interfaces would mean either duplicating the code, or a large refactor to move the shared code into another class that could be composited with the two classes.
Feb
5
asked Changing method signature for implementing classes in PHP
Oct
31
asked Should mock objects for tests be created at a high or low level
Jul
12
awarded  Scholar
Jul
12
accepted Non-trivial get function, should it be named differently
Jul
12
awarded  Editor
Jul
12
awarded  Supporter
Jul
12
revised Non-trivial get function, should it be named differently
Clarified return types.
Jul
12
comment Non-trivial get function, should it be named differently
Sorry, I'll clarify it. Both the Command::getResponseFactory and service->getResponseFactory return the same type, a string - which is admittedly another smell.
Jul
12
awarded  Student
Jul
12
comment Non-trivial get function, should it be named differently
"What would you call it?" Maybe 'getEffectiveResponseFactory'? Which kind of sucks.
Jul
12
asked Non-trivial get function, should it be named differently
May
22
answered How do I handle 3rd party search result data (via cache)
May
22
comment How do I handle 3rd party search result data (via cache)
Why is memcache not an option? md5 the request parameters, store the result with the md5 as the key?
May
19
awarded  Teacher
May
19
answered Base64 decode and SH1 decryption of Sec-WebSocket-Accept value example from Websocket RFC
May
5
comment What data structure is suitable for implementing dynamic huffman encoding and decoding on a piece of text?
There's a complete example in C++ at github.com/ikalnitsky/yaahc which uses it's own custom tree using the FGK algorithm. Are you looking for something different than that? Or do you just want to write your own from scratch?
Dec
11
awarded  Autobiographer