[PEPr] Comment on Payment::PagamentoCerto
| From: | Michael Gauthier | Date: | Mon, 17 Nov 2008 03:29:34 +0000 |
| Subject: | [PEPr] Comment on Payment::PagamentoCerto | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51099@lists.php.net to get a copy of this message | ||
Michael Gauthier (http://pear.php.net/user/gauthierm) has commented on the proposal for
Payment::PagamentoCerto.
Comment:
Looks good. Initial comments:
1.) You should tun the code through phpcs. It will turn up several minor
errors which should be easy to fix.
2.) You should build the XML with the DOM or simplexml methods. This will
automatically handle escaping where it is required.
3.) Converting values to cents should go in its own method.
4.) Lastly, I find the pattern
===
if (!in_array($foo, $bar)) {
throw new Exception(...);
}
// do stuff
===
works better than
===
if (in_array($foo, $bar)) {
// do stuff
} else {
throw new Exception(...);
}
===
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=583
--
Sent by PEPr, the automatic proposal system at http://pear.php.net