Vote Details for "Services_Hatena" by justinpatrin

» Details
» Comment
Use single qoutes for your strings (be consistent!).

Use html_entitiy_decode() instead of strtr in _Autolink.

If this package will stay as PHP5 only, all errors should throw a PEAR_Exception (Actually it should use an exception class extended from it for your package). See the PEAR_Exception class, RFC, and wiki page which discuss it.

If you decide to make this package PHP4 compatible, methods where an error could happen should return the PEAR_Error, not just set it internally.

Additionally, $this->result should likely be removed entirely. You're using it as a place to store the return value of functions instead of returning it. Please change your functions to return their results instead of setting an internal variable. (Indeed, some of your docblocks list a @return when you don't actually return...)

All sub-blocks of code (such as inside conditionals and loops) must have { } around them. No:
if ($var == 'val')
return 'hi';
if ($var == 'val') {
return 'hi';

In Search::getNextPage can $c be 0? If so, make sure that you check it before dividing to avoid divide by zero errors.

Remove the empty else blocks in Search.