Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.0

Request #17548 Refactor output methods
Submitted: 2010-07-02 04:29 UTC
From: doconnor Assigned:
Status: Open Package: Net_IDNA2 (version SVN)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2010-07-02 04:29 UTC] doconnor (Daniel O'Connor)
Description: ------------ This is horrid: switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) { case 'utf8': return $return; break; case 'ucs4_string': return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return)); break; case 'ucs4_array': return $this->_utf8_to_ucs4($return); break; default: throw new Exception('Unsupported output format'); } 1. Refactor the assorted private methods into classes for rendering output 2. Inject the appropriate one at the appropriate time 3. Test the heck out of it

Comments