@@ -155,7 +155,15 @@ discard block |
||
155 | 155 | function get_id() { return $this->_frame->get_id(); } |
156 | 156 | function get_style() { return $this->_frame->get_style(); } |
157 | 157 | function get_original_style() { return $this->_frame->get_original_style(); } |
158 | + |
|
159 | + /** |
|
160 | + * @param string $i |
|
161 | + */ |
|
158 | 162 | function get_containing_block($i = null) { return $this->_frame->get_containing_block($i); } |
163 | + |
|
164 | + /** |
|
165 | + * @param string $i |
|
166 | + */ |
|
159 | 167 | function get_position($i = null) { return $this->_frame->get_position($i); } |
160 | 168 | function get_dompdf() { return $this->_dompdf; } |
161 | 169 | // function get_decorator() { |
@@ -173,6 +181,12 @@ discard block |
||
173 | 181 | function set_id($id) { $this->_frame->set_id($id); } |
174 | 182 | function set_style(Style $style) { $this->_frame->set_style($style); } |
175 | 183 | |
184 | + /** |
|
185 | + * @param double $x |
|
186 | + * @param double $y |
|
187 | + * @param double $w |
|
188 | + * @param double $h |
|
189 | + */ |
|
176 | 190 | function set_containing_block($x = null, $y = null, $w = null, $h = null) { |
177 | 191 | $this->_frame->set_containing_block($x, $y, $w, $h); |
178 | 192 | } |
@@ -60,6 +60,10 @@ |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // FIXME: this is admittedly a little smelly... |
63 | + |
|
64 | + /** |
|
65 | + * @param DOMPDF $dompdf |
|
66 | + */ |
|
63 | 67 | static function decorate_frame(Frame $frame, $dompdf) { |
64 | 68 | if ( is_null($dompdf) ) |
65 | 69 | throw new Exception("foo"); |
@@ -305,6 +305,10 @@ discard block |
||
305 | 305 | */ |
306 | 306 | |
307 | 307 | if ( !function_exists("mb_convert_encoding") ) { |
308 | + |
|
309 | + /** |
|
310 | + * @param string|null $to_encoding |
|
311 | + */ |
|
308 | 312 | function mb_convert_encoding($data, $to_encoding, $from_encoding='UTF-8') { |
309 | 313 | if (str_replace('-', '', strtolower($to_encoding)) == 'utf8') { |
310 | 314 | return utf8_encode($data); |
@@ -327,6 +331,10 @@ discard block |
||
327 | 331 | } |
328 | 332 | |
329 | 333 | if ( !function_exists("mb_internal_encoding") ) { |
334 | + |
|
335 | + /** |
|
336 | + * @param string $encoding |
|
337 | + */ |
|
330 | 338 | function mb_internal_encoding($encoding=NULL) { |
331 | 339 | if (isset($encoding)) { |
332 | 340 | return true; |
@@ -365,6 +373,10 @@ discard block |
||
365 | 373 | } |
366 | 374 | |
367 | 375 | if ( !function_exists("mb_strtoupper") ) { |
376 | + |
|
377 | + /** |
|
378 | + * @param string $str |
|
379 | + */ |
|
368 | 380 | function mb_strtoupper($str) { |
369 | 381 | return strtoupper($str); |
370 | 382 | } |
@@ -380,6 +392,10 @@ discard block |
||
380 | 392 | } |
381 | 393 | |
382 | 394 | if ( !function_exists("mb_substr_count") ) { |
395 | + |
|
396 | + /** |
|
397 | + * @param string $needle |
|
398 | + */ |
|
383 | 399 | function mb_substr_count($haystack, $needle) { |
384 | 400 | return substr_count($haystack, $needle); |
385 | 401 | } |
@@ -442,6 +458,7 @@ discard block |
||
442 | 458 | * Print debug messages |
443 | 459 | * |
444 | 460 | * @param string $type The type of debug messages to print |
461 | + * @param string $msg |
|
445 | 462 | */ |
446 | 463 | function dompdf_debug($type, $msg) { |
447 | 464 | global $_DOMPDF_DEBUG_TYPES; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param mixed $size The size of image to create: array(x1,y1,x2,y2) or "letter", "legal", etc. |
98 | 98 | * @param string $orientation The orientation of the document (either 'landscape' or 'portrait') |
99 | - * @param float $aa_factor Anti-aliasing factor, 1 for no AA |
|
99 | + * @param integer $aa_factor Anti-aliasing factor, 1 for no AA |
|
100 | 100 | * @param array $bg_color Image background color: array(r,g,b,a), 0 <= r,g,b,a <= 1 |
101 | 101 | */ |
102 | 102 | function __construct($size, $orientation = "portrait", $aa_factor = 1, $bg_color = array(1,1,1,0) ) { |
@@ -536,8 +536,8 @@ discard block |
||
536 | 536 | * @param string $font the font file to use |
537 | 537 | * @param float $size the font size, in points |
538 | 538 | * @param array $color |
539 | - * @param float $adjust word spacing adjustment |
|
540 | - * @param float $angle Text angle |
|
539 | + * @param integer $adjust word spacing adjustment |
|
540 | + * @param integer $angle Text angle |
|
541 | 541 | */ |
542 | 542 | function text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0, $angle = 0) { |
543 | 543 | |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | * @param string $text the text to be sized |
591 | 591 | * @param string $font the desired font |
592 | 592 | * @param float $size the desired font size |
593 | - * @param float $spacing word spacing, if any |
|
593 | + * @param integer $spacing word spacing, if any |
|
594 | 594 | * @return float |
595 | 595 | */ |
596 | 596 | function get_text_width($text, $font, $size, $spacing = 0) { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Return the bullet's width |
111 | 111 | * |
112 | - * @return int |
|
112 | + * @return double |
|
113 | 113 | */ |
114 | 114 | function get_width() { |
115 | 115 | //ignore image width, use same width as on predefined bullet List_Bullet_Frame_Decorator |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | /** |
160 | 160 | * Override get_margin_height() |
161 | 161 | * |
162 | - * @return int |
|
162 | + * @return double |
|
163 | 163 | */ |
164 | 164 | function get_margin_height() { |
165 | 165 | //Hits only on "inset" lists items, to increase height of box |
@@ -70,12 +70,19 @@ |
||
70 | 70 | |
71 | 71 | function __construct() { throw new Exception("Can not create instance of Page_Class. Class is static."); } |
72 | 72 | |
73 | + /** |
|
74 | + * @param string $sql |
|
75 | + */ |
|
73 | 76 | private static function __query($sql) { |
74 | 77 | if ( !($res = pg_query(self::$__connection, $sql)) ) |
75 | 78 | throw new Exception(pg_last_error(self::$__connection)); |
76 | 79 | return $res; |
77 | 80 | } |
78 | 81 | |
82 | + /** |
|
83 | + * @param integer $page_num |
|
84 | + * @param string|null $data |
|
85 | + */ |
|
79 | 86 | static function store_page($id, $page_num, $data) { |
80 | 87 | $where = "WHERE id='" . pg_escape_string($id) . "' AND ". |
81 | 88 | "page_num=". pg_escape_string($page_num); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @link http://www.w3.org/TR/CSS21/page.html#forced |
172 | 172 | * |
173 | 173 | * @param Frame $frame the frame to check |
174 | - * @return bool true if a page break occured |
|
174 | + * @return null|boolean true if a page break occured |
|
175 | 175 | */ |
176 | 176 | function check_forced_page_break(Frame $frame) { |
177 | 177 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | * correct location. |
427 | 427 | * |
428 | 428 | * @param Frame $frame the frame to check |
429 | - * @return Frame the frame following the page break |
|
429 | + * @return boolean the frame following the page break |
|
430 | 430 | */ |
431 | 431 | function check_page_break(Frame $frame) { |
432 | 432 | // Do not split if we have already |
@@ -442,6 +442,9 @@ discard block |
||
442 | 442 | * @param string corner |
443 | 443 | * @param string join |
444 | 444 | * @param array dash |
445 | + * @param double $width |
|
446 | + * @param string $cap |
|
447 | + * @param string $join |
|
445 | 448 | */ |
446 | 449 | protected function _set_line_style($width, $cap, $join, $dash) { |
447 | 450 | |
@@ -795,8 +798,8 @@ discard block |
||
795 | 798 | * @param string $font the font file to use |
796 | 799 | * @param float $size the font size, in points |
797 | 800 | * @param array $color |
798 | - * @param float $adjust word spacing adjustment |
|
799 | - * @param float $angle angle to write the text at, measured CW starting from the x-axis |
|
801 | + * @param integer $adjust word spacing adjustment |
|
802 | + * @param integer $angle angle to write the text at, measured CW starting from the x-axis |
|
800 | 803 | */ |
801 | 804 | function page_text($x, $y, $text, $font, $size, $color = array(0,0,0), |
802 | 805 | $adjust = 0, $angle = 0, $blend = "Normal", $opacity = 1.0) { |
@@ -742,6 +742,10 @@ discard block |
||
742 | 742 | * Assume that __set will be also called when this is called, so do not check validity again. |
743 | 743 | * Only created, if !important exists -> always set true. |
744 | 744 | */ |
745 | + |
|
746 | + /** |
|
747 | + * @param string $prop |
|
748 | + */ |
|
745 | 749 | function important_set($prop) { |
746 | 750 | $prop = str_replace("-", "_", $prop); |
747 | 751 | $this->_important_props[$prop] = true; |
@@ -1276,7 +1280,8 @@ discard block |
||
1276 | 1280 | /** |
1277 | 1281 | * Return a single border property |
1278 | 1282 | * |
1279 | - * @return mixed |
|
1283 | + * @param string $side |
|
1284 | + * @return string |
|
1280 | 1285 | */ |
1281 | 1286 | protected function _get_border($side) { |
1282 | 1287 | $color = $this->__get("border_" . $side . "_color"); |
@@ -1363,6 +1368,10 @@ discard block |
||
1363 | 1368 | * Applicable for background, border, padding, margin, font, list_style |
1364 | 1369 | * Note: $type has a leading underscore (or is empty), the others not. |
1365 | 1370 | */ |
1371 | + |
|
1372 | + /** |
|
1373 | + * @param string $side |
|
1374 | + */ |
|
1366 | 1375 | protected function _set_style_side_type($style,$side,$type,$val,$important) { |
1367 | 1376 | if ( !isset($this->_important_props[$style.'_'.$side.$type]) || $important) { |
1368 | 1377 | //see __set and __get, on all assignments clear cache! |
@@ -1381,6 +1390,9 @@ discard block |
||
1381 | 1390 | $this->_set_style_side_type($style,'left',$type,$left,$important); |
1382 | 1391 | } |
1383 | 1392 | |
1393 | + /** |
|
1394 | + * @param boolean $important |
|
1395 | + */ |
|
1384 | 1396 | protected function _set_style_type($style,$type,$val,$important) { |
1385 | 1397 | $arr = explode(" ", $val); |
1386 | 1398 | switch (count($arr)) { |
@@ -1404,6 +1416,10 @@ discard block |
||
1404 | 1416 | $this->_props[$style.$type] = $val; |
1405 | 1417 | } |
1406 | 1418 | |
1419 | + /** |
|
1420 | + * @param string $style |
|
1421 | + * @param string $type |
|
1422 | + */ |
|
1407 | 1423 | protected function _set_style_type_important($style,$type,$val) { |
1408 | 1424 | $this->_set_style_type($style,$type,$val,isset($this->_important_props[$style.$type])); |
1409 | 1425 | } |
@@ -1411,12 +1427,21 @@ discard block |
||
1411 | 1427 | /* Anyway only called if _important matches and is assigned |
1412 | 1428 | * E.g. _set_style_side_type($style,$side,'',str_replace("none", "0px", $val),isset($this->_important_props[$style.'_'.$side])); |
1413 | 1429 | */ |
1430 | + |
|
1431 | + /** |
|
1432 | + * @param string $style |
|
1433 | + * @param string $side |
|
1434 | + */ |
|
1414 | 1435 | protected function _set_style_side_width_important($style,$side,$val) { |
1415 | 1436 | //see __set and __get, on all assignments clear cache! |
1416 | 1437 | $this->_prop_cache[$style.'_'.$side] = null; |
1417 | 1438 | $this->_props[$style.'_'.$side] = str_replace("none", "0px", $val); |
1418 | 1439 | } |
1419 | 1440 | |
1441 | + /** |
|
1442 | + * @param string $style |
|
1443 | + * @param boolean $important |
|
1444 | + */ |
|
1420 | 1445 | protected function _set_style($style,$val,$important) { |
1421 | 1446 | if ( !isset($this->_important_props[$style]) || $important) { |
1422 | 1447 | if ($important) { |
@@ -1505,7 +1530,6 @@ discard block |
||
1505 | 1530 | * Set the background image url |
1506 | 1531 | * |
1507 | 1532 | * @link http://www.w3.org/TR/CSS21/colors.html#background-properties |
1508 | - * @param string $url |
|
1509 | 1533 | */ |
1510 | 1534 | function set_background_image($val) { |
1511 | 1535 | //see __set and __get, on all assignments clear cache, not needed on direct set through __set |
@@ -1769,6 +1793,7 @@ discard block |
||
1769 | 1793 | * |
1770 | 1794 | * @param string $side |
1771 | 1795 | * @param string $border_spec ([width] [style] [color]) |
1796 | + * @param boolean $important |
|
1772 | 1797 | */ |
1773 | 1798 | protected function _set_border($side, $border_spec, $important) { |
1774 | 1799 | $border_spec = str_replace(",", " ", $border_spec); |