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

Request #11665 LOC RR Type
Submitted: 2007-07-22 15:29 UTC
From: wnagele Assigned: bate
Status: Closed Package: Net_DNS (version 1.0.0)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-07-22 15:29 UTC] wnagele (Wolfgang Nagele)
Description: ------------ It would be nice to have the RR type LOC for GPS data supported. For more information see: http://en.wikipedia.org/wiki/LOC_record

Comments

 [2007-11-30 12:52 UTC] bate (Marco Kaiser)
I will add this feature in one of the next releases.
 [2010-04-06 00:00 UTC] ian (ian pye)
 [2010-04-12 05:53 UTC] doconnor (Daniel O'Connor)
Re the patch, a couple of pointers: 1) We love unit tests and other test coverage. It lets us prove we haven't broken anything. 2) Avoid work in the constructor - just set up the initial state of your class. This makes for easier unit test coverage / mocking 3) Avoid global state where you can - global state makes it harder to test 4) Coding style - try running PHP_CodeSniffer over the code - it'll pick on lots of little things 5) Think a bit about method names and docblocks for them - as an outsider, I find it difficult to understand what the methods on the class do most of the time.
 [2010-04-13 10:18 UTC] ian (ian pye)
 [2010-04-13 11:26 UTC] doconnor (Daniel O'Connor)
:D Much better re the patch. 1) I'm still going to be a pain and see if you can avoid work in the constructor. You have function __construct() { + // Finally parse the actual data. + $this->parse_data(); } and bits like + if (!$this->parsed) { + $this->parse_data(); + } If you shifted it out of the constructor, you could make that much more explicit: $foo = new Foo($data); $foo->parse(); // I know for sure things are parsed at the moment :) Again, this is mainly so you can mock things out when unit testing. 2) Avoid statics (Static is very similar to global state.) - use class constants if they are immutable things :) + + // Static constants + // Reference altitude in centimeters (see RFC 1876). + public static $reference_alt = 10000000; + // Reference lat/lon (see RFC 1876). + public static $reference_latlon = 2147483648; // pow(2, 31); + + // Conversions to/from thousandths of a degree. + public static $conv_sec = 1000; // 1000 milisecs. + public static $conv_min = 60000; // sec * 60 + public static $conv_deg = 3600000; // min * 60 + + // Defaults (from RFC 1876, Section 3). + public static $default_min = 0; + public static $default_sec = 0; + public static $default_size = 1; + public static $default_horiz_pre = 10000; + public static $default_vert_pre = 10; Apart from that, I'm happy enough - unit tests would be nice, but aren't strictly needed.
 [2010-04-13 11:40 UTC] doconnor (Daniel O'Connor)
Scratch what I said about using class constants, we have to maintain PHP4 compat here :(
 [2010-04-13 11:51 UTC] doconnor (Daniel O'Connor)
Test coverage skeleton is in svn
 [2010-08-09 20:18 UTC] bate (Marco Kaiser)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.