@@ -123,6 +123,9 @@ discard block |
||
| 123 | 123 | return new Polygon($components); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | + /** |
|
| 127 | + * @param string $type |
|
| 128 | + */ |
|
| 126 | 129 | function getMulti(&$mem, $type) {
|
| 127 | 130 | // Get the number of items expected in this multi out of the first 4 bytes |
| 128 | 131 | $multi_length = unpack('L',fread($mem,4));
|
@@ -196,6 +199,9 @@ discard block |
||
| 196 | 199 | } |
| 197 | 200 | } |
| 198 | 201 | |
| 202 | + /** |
|
| 203 | + * @param Geometry $point |
|
| 204 | + */ |
|
| 199 | 205 | function writePoint($point) {
|
| 200 | 206 | // Set the coords |
| 201 | 207 | $wkb = pack('dd',$point->x(), $point->y());
|
@@ -215,6 +221,9 @@ discard block |
||
| 215 | 221 | return $wkb; |
| 216 | 222 | } |
| 217 | 223 | |
| 224 | + /** |
|
| 225 | + * @param Geometry $poly |
|
| 226 | + */ |
|
| 218 | 227 | function writePolygon($poly) {
|
| 219 | 228 | // Set the number of lines in this poly |
| 220 | 229 | $wkb = pack('L',$poly->numGeometries());
|
@@ -227,6 +236,9 @@ discard block |
||
| 227 | 236 | return $wkb; |
| 228 | 237 | } |
| 229 | 238 | |
| 239 | + /** |
|
| 240 | + * @param Geometry $geometry |
|
| 241 | + */ |
|
| 230 | 242 | function writeMulti($geometry) {
|
| 231 | 243 | // Set the number of components |
| 232 | 244 | $wkb = pack('L',$geometry->numGeometries());
|
@@ -8,7 +8,6 @@ discard block |
||
| 8 | 8 | /** |
| 9 | 9 | * Read WKT string into geometry objects |
| 10 | 10 | * |
| 11 | - * @param string $WKT A WKT string |
|
| 12 | 11 | * |
| 13 | 12 | * @return Geometry |
| 14 | 13 | */ |
@@ -184,11 +183,17 @@ discard block |
||
| 184 | 183 | else return $str; |
| 185 | 184 | } |
| 186 | 185 | |
| 186 | + /** |
|
| 187 | + * @param string $char |
|
| 188 | + */ |
|
| 187 | 189 | protected function beginsWith($str, $char) { |
| 188 | 190 | if (substr($str,0,strlen($char)) == $char) return TRUE; |
| 189 | 191 | else return FALSE; |
| 190 | 192 | } |
| 191 | 193 | |
| 194 | + /** |
|
| 195 | + * @param string $char |
|
| 196 | + */ |
|
| 192 | 197 | protected function endsWith($str, $char) { |
| 193 | 198 | if (substr($str,(0 - strlen($char))) == $char) return TRUE; |
| 194 | 199 | else return FALSE; |
@@ -193,6 +193,9 @@ |
||
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | + /** |
|
| 197 | + * @param Point $point |
|
| 198 | + */ |
|
| 196 | 199 | public function pointOnVertex($point) { |
| 197 | 200 | foreach($this->getPoints() as $vertex) { |
| 198 | 201 | if ($point->equals($vertex)) { |
@@ -41,6 +41,10 @@ |
||
| 41 | 41 | print "Testing Done!"; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | +/** |
|
| 45 | + * @param resource $connection |
|
| 46 | + * @param string $format |
|
| 47 | + */ |
|
| 44 | 48 | function test_postgis($name, $type, $geom, $connection, $format) { |
| 45 | 49 | global $table; |
| 46 | 50 | |
@@ -112,6 +112,9 @@ discard block |
||
| 112 | 112 | $geometry->m(); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | +/** |
|
| 116 | + * @param string $input |
|
| 117 | + */ |
|
| 115 | 118 | function test_adapters($geometry, $format, $input) { |
| 116 | 119 | // Test adapter output and input. Do a round-trip and re-test |
| 117 | 120 | foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) { |
@@ -234,6 +237,9 @@ discard block |
||
| 234 | 237 | } |
| 235 | 238 | } |
| 236 | 239 | |
| 240 | +/** |
|
| 241 | + * @param string $value |
|
| 242 | + */ |
|
| 237 | 243 | function test_detection($value, $format, $file) { |
| 238 | 244 | $detected = geoPHP::detectFormat($value); |
| 239 | 245 | if ($detected != $format) { |
@@ -58,6 +58,10 @@ |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param string $method_name |
|
| 63 | + * @param string|null $argument |
|
| 64 | + */ |
|
| 61 | 65 | function _methods_tester($geometry, $method_name, $argument) { |
| 62 | 66 | |
| 63 | 67 | if (!method_exists($geometry, $method_name)) { |
@@ -122,6 +122,9 @@ |
||
| 122 | 122 | return self::array_random( empty( $lang ) ? self::$languages : $lang ); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $os |
|
| 127 | + */ |
|
| 125 | 128 | private static function get_processor( $os ) |
| 126 | 129 | { |
| 127 | 130 | return self::array_random( self::$processors[$os] ); |
@@ -125,6 +125,9 @@ discard block |
||
| 125 | 125 | public $tag_start = 0; |
| 126 | 126 | private $dom = null; |
| 127 | 127 | |
| 128 | + /** |
|
| 129 | + * @param simple_html_dom $dom |
|
| 130 | + */ |
|
| 128 | 131 | function __construct($dom) |
| 129 | 132 | { |
| 130 | 133 | $this->dom = $dom; |
@@ -1501,6 +1504,11 @@ discard block |
||
| 1501 | 1504 | } |
| 1502 | 1505 | |
| 1503 | 1506 | // parse attributes |
| 1507 | + |
|
| 1508 | + /** |
|
| 1509 | + * @param simple_html_dom_node $node |
|
| 1510 | + * @param string[] $space |
|
| 1511 | + */ |
|
| 1504 | 1512 | protected function parse_attr($node, $name, &$space) |
| 1505 | 1513 | { |
| 1506 | 1514 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1546,11 @@ discard block |
||
| 1538 | 1546 | } |
| 1539 | 1547 | |
| 1540 | 1548 | // link node's parent |
| 1549 | + |
|
| 1550 | + /** |
|
| 1551 | + * @param simple_html_dom_node $node |
|
| 1552 | + * @param boolean $is_child |
|
| 1553 | + */ |
|
| 1541 | 1554 | protected function link_nodes(&$node, $is_child) |
| 1542 | 1555 | { |
| 1543 | 1556 | $node->parent = $this->parent; |
@@ -1549,6 +1562,10 @@ discard block |
||
| 1549 | 1562 | } |
| 1550 | 1563 | |
| 1551 | 1564 | // as a text node |
| 1565 | + |
|
| 1566 | + /** |
|
| 1567 | + * @param string $tag |
|
| 1568 | + */ |
|
| 1552 | 1569 | protected function as_text_node($tag) |
| 1553 | 1570 | { |
| 1554 | 1571 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1576,18 @@ discard block |
||
| 1559 | 1576 | return true; |
| 1560 | 1577 | } |
| 1561 | 1578 | |
| 1579 | + /** |
|
| 1580 | + * @param string $chars |
|
| 1581 | + */ |
|
| 1562 | 1582 | protected function skip($chars) |
| 1563 | 1583 | { |
| 1564 | 1584 | $this->pos += strspn($this->doc, $chars, $this->pos); |
| 1565 | 1585 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
| 1566 | 1586 | } |
| 1567 | 1587 | |
| 1588 | + /** |
|
| 1589 | + * @param string $chars |
|
| 1590 | + */ |
|
| 1568 | 1591 | protected function copy_skip($chars) |
| 1569 | 1592 | { |
| 1570 | 1593 | $pos = $this->pos; |
@@ -1575,6 +1598,9 @@ discard block |
||
| 1575 | 1598 | return substr($this->doc, $pos, $len); |
| 1576 | 1599 | } |
| 1577 | 1600 | |
| 1601 | + /** |
|
| 1602 | + * @param string $chars |
|
| 1603 | + */ |
|
| 1578 | 1604 | protected function copy_until($chars) |
| 1579 | 1605 | { |
| 1580 | 1606 | $pos = $this->pos; |
@@ -1584,6 +1610,9 @@ discard block |
||
| 1584 | 1610 | return substr($this->doc, $pos, $len); |
| 1585 | 1611 | } |
| 1586 | 1612 | |
| 1613 | + /** |
|
| 1614 | + * @param string $char |
|
| 1615 | + */ |
|
| 1587 | 1616 | protected function copy_until_char($char) |
| 1588 | 1617 | { |
| 1589 | 1618 | if ($this->char===null) return ''; |
@@ -1602,6 +1631,9 @@ discard block |
||
| 1602 | 1631 | return substr($this->doc, $pos_old, $pos-$pos_old); |
| 1603 | 1632 | } |
| 1604 | 1633 | |
| 1634 | + /** |
|
| 1635 | + * @param string $char |
|
| 1636 | + */ |
|
| 1605 | 1637 | protected function copy_until_char_escape($char) |
| 1606 | 1638 | { |
| 1607 | 1639 | if ($this->char===null) return ''; |
@@ -1633,6 +1665,10 @@ discard block |
||
| 1633 | 1665 | |
| 1634 | 1666 | // remove noise from html content |
| 1635 | 1667 | // save the noise in the $this->noise array. |
| 1668 | + |
|
| 1669 | + /** |
|
| 1670 | + * @param string $pattern |
|
| 1671 | + */ |
|
| 1636 | 1672 | protected function remove_noise($pattern, $remove_tag=false) |
| 1637 | 1673 | { |
| 1638 | 1674 | global $debug_object; |
@@ -1658,6 +1694,10 @@ discard block |
||
| 1658 | 1694 | } |
| 1659 | 1695 | |
| 1660 | 1696 | // restore noise to html content |
| 1697 | + |
|
| 1698 | + /** |
|
| 1699 | + * @param string|null $text |
|
| 1700 | + */ |
|
| 1661 | 1701 | function restore_noise($text) |
| 1662 | 1702 | { |
| 1663 | 1703 | global $debug_object; |
@@ -125,6 +125,9 @@ discard block |
||
| 125 | 125 | public $tag_start = 0; |
| 126 | 126 | private $dom = null; |
| 127 | 127 | |
| 128 | + /** |
|
| 129 | + * @param simple_html_dom $dom |
|
| 130 | + */ |
|
| 128 | 131 | function __construct($dom) |
| 129 | 132 | { |
| 130 | 133 | $this->dom = $dom; |
@@ -1501,6 +1504,11 @@ discard block |
||
| 1501 | 1504 | } |
| 1502 | 1505 | |
| 1503 | 1506 | // parse attributes |
| 1507 | + |
|
| 1508 | + /** |
|
| 1509 | + * @param simple_html_dom_node $node |
|
| 1510 | + * @param string[] $space |
|
| 1511 | + */ |
|
| 1504 | 1512 | protected function parse_attr($node, $name, &$space) |
| 1505 | 1513 | { |
| 1506 | 1514 | // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 |
@@ -1538,6 +1546,11 @@ discard block |
||
| 1538 | 1546 | } |
| 1539 | 1547 | |
| 1540 | 1548 | // link node's parent |
| 1549 | + |
|
| 1550 | + /** |
|
| 1551 | + * @param simple_html_dom_node $node |
|
| 1552 | + * @param boolean $is_child |
|
| 1553 | + */ |
|
| 1541 | 1554 | protected function link_nodes(&$node, $is_child) |
| 1542 | 1555 | { |
| 1543 | 1556 | $node->parent = $this->parent; |
@@ -1549,6 +1562,10 @@ discard block |
||
| 1549 | 1562 | } |
| 1550 | 1563 | |
| 1551 | 1564 | // as a text node |
| 1565 | + |
|
| 1566 | + /** |
|
| 1567 | + * @param string $tag |
|
| 1568 | + */ |
|
| 1552 | 1569 | protected function as_text_node($tag) |
| 1553 | 1570 | { |
| 1554 | 1571 | $node = new simple_html_dom_node($this); |
@@ -1559,12 +1576,18 @@ discard block |
||
| 1559 | 1576 | return true; |
| 1560 | 1577 | } |
| 1561 | 1578 | |
| 1579 | + /** |
|
| 1580 | + * @param string $chars |
|
| 1581 | + */ |
|
| 1562 | 1582 | protected function skip($chars) |
| 1563 | 1583 | { |
| 1564 | 1584 | $this->pos += strspn($this->doc, $chars, $this->pos); |
| 1565 | 1585 | $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next |
| 1566 | 1586 | } |
| 1567 | 1587 | |
| 1588 | + /** |
|
| 1589 | + * @param string $chars |
|
| 1590 | + */ |
|
| 1568 | 1591 | protected function copy_skip($chars) |
| 1569 | 1592 | { |
| 1570 | 1593 | $pos = $this->pos; |
@@ -1575,6 +1598,9 @@ discard block |
||
| 1575 | 1598 | return substr($this->doc, $pos, $len); |
| 1576 | 1599 | } |
| 1577 | 1600 | |
| 1601 | + /** |
|
| 1602 | + * @param string $chars |
|
| 1603 | + */ |
|
| 1578 | 1604 | protected function copy_until($chars) |
| 1579 | 1605 | { |
| 1580 | 1606 | $pos = $this->pos; |
@@ -1584,6 +1610,9 @@ discard block |
||
| 1584 | 1610 | return substr($this->doc, $pos, $len); |
| 1585 | 1611 | } |
| 1586 | 1612 | |
| 1613 | + /** |
|
| 1614 | + * @param string $char |
|
| 1615 | + */ |
|
| 1587 | 1616 | protected function copy_until_char($char) |
| 1588 | 1617 | { |
| 1589 | 1618 | if ($this->char===null) return ''; |
@@ -1602,6 +1631,9 @@ discard block |
||
| 1602 | 1631 | return substr($this->doc, $pos_old, $pos-$pos_old); |
| 1603 | 1632 | } |
| 1604 | 1633 | |
| 1634 | + /** |
|
| 1635 | + * @param string $char |
|
| 1636 | + */ |
|
| 1605 | 1637 | protected function copy_until_char_escape($char) |
| 1606 | 1638 | { |
| 1607 | 1639 | if ($this->char===null) return ''; |
@@ -1633,6 +1665,10 @@ discard block |
||
| 1633 | 1665 | |
| 1634 | 1666 | // remove noise from html content |
| 1635 | 1667 | // save the noise in the $this->noise array. |
| 1668 | + |
|
| 1669 | + /** |
|
| 1670 | + * @param string $pattern |
|
| 1671 | + */ |
|
| 1636 | 1672 | protected function remove_noise($pattern, $remove_tag=false) |
| 1637 | 1673 | { |
| 1638 | 1674 | global $debug_object; |
@@ -1658,6 +1694,10 @@ discard block |
||
| 1658 | 1694 | } |
| 1659 | 1695 | |
| 1660 | 1696 | // restore noise to html content |
| 1697 | + |
|
| 1698 | + /** |
|
| 1699 | + * @param string|null $text |
|
| 1700 | + */ |
|
| 1661 | 1701 | function restore_noise($text) |
| 1662 | 1702 | { |
| 1663 | 1703 | global $debug_object; |