@@ -2409,8 +2409,8 @@ discard block |
||
2409 | 2409 | |
2410 | 2410 | case 'font': |
2411 | 2411 | $this->objects[$id]['fonts'][$options['fontNum']] = [ |
2412 | - 'objNum' => $options['objNum'], |
|
2413 | - 'fontNum' => $options['fontNum'] |
|
2412 | + 'objNum' => $options['objNum'], |
|
2413 | + 'fontNum' => $options['fontNum'] |
|
2414 | 2414 | ]; |
2415 | 2415 | break; |
2416 | 2416 | |
@@ -2504,8 +2504,8 @@ discard block |
||
2504 | 2504 | |
2505 | 2505 | case 'font': |
2506 | 2506 | $this->objects[$id]['fonts'][$options['fontNum']] = [ |
2507 | - 'objNum' => $options['objNum'], |
|
2508 | - 'fontNum' => $options['fontNum'] |
|
2507 | + 'objNum' => $options['objNum'], |
|
2508 | + 'fontNum' => $options['fontNum'] |
|
2509 | 2509 | ]; |
2510 | 2510 | break; |
2511 | 2511 | |
@@ -2732,7 +2732,7 @@ discard block |
||
2732 | 2732 | case 'ContactInfo': |
2733 | 2733 | if ($v !== null && $v !== '') { |
2734 | 2734 | $res .= "/$k (" . |
2735 | - ($encrypted ? $this->filterText($this->ARC4($v), false, false) : $v) . ") \n"; |
|
2735 | + ($encrypted ? $this->filterText($this->ARC4($v), false, false) : $v) . ") \n"; |
|
2736 | 2736 | } |
2737 | 2737 | break; |
2738 | 2738 | } |
@@ -4299,13 +4299,13 @@ discard block |
||
4299 | 4299 | function addSignature($signcert, $privkey, $password = '', $name = null, $location = null, $reason = null, $contactinfo = null) { |
4300 | 4300 | $sigId = ++$this->numObj; |
4301 | 4301 | $this->o_sig($sigId, 'new', [ |
4302 | - 'SignCert' => $signcert, |
|
4303 | - 'PrivKey' => $privkey, |
|
4304 | - 'Password' => $password, |
|
4305 | - 'Name' => $name, |
|
4306 | - 'Location' => $location, |
|
4307 | - 'Reason' => $reason, |
|
4308 | - 'ContactInfo' => $contactinfo |
|
4302 | + 'SignCert' => $signcert, |
|
4303 | + 'PrivKey' => $privkey, |
|
4304 | + 'Password' => $password, |
|
4305 | + 'Name' => $name, |
|
4306 | + 'Location' => $location, |
|
4307 | + 'Reason' => $reason, |
|
4308 | + 'ContactInfo' => $contactinfo |
|
4309 | 4309 | ]); |
4310 | 4310 | |
4311 | 4311 | return $sigId; |
@@ -4340,17 +4340,17 @@ discard block |
||
4340 | 4340 | ); |
4341 | 4341 | |
4342 | 4342 | $this->o_acroform($this->acroFormId, 'font', |
4343 | - ['objNum' => $font[0]['objNum'], 'fontNum' => $font[0]['fontNum']]); |
|
4343 | + ['objNum' => $font[0]['objNum'], 'fontNum' => $font[0]['fontNum']]); |
|
4344 | 4344 | |
4345 | 4345 | $fieldId = ++$this->numObj; |
4346 | 4346 | $this->o_field($fieldId, 'new', [ |
4347 | - 'rect' => [$x0, $y0, $x1, $y1], |
|
4348 | - 'F' => 4, |
|
4349 | - 'FT' => "/$type", |
|
4350 | - 'T' => $name, |
|
4351 | - 'Ff' => $ff, |
|
4352 | - 'pageid' => $this->currentPage, |
|
4353 | - 'da' => "$color /F$this->currentFontNum " . sprintf('%.1F Tf ', $size) |
|
4347 | + 'rect' => [$x0, $y0, $x1, $y1], |
|
4348 | + 'F' => 4, |
|
4349 | + 'FT' => "/$type", |
|
4350 | + 'T' => $name, |
|
4351 | + 'Ff' => $ff, |
|
4352 | + 'pageid' => $this->currentPage, |
|
4353 | + 'da' => "$color /F$this->currentFontNum " . sprintf('%.1F Tf ', $size) |
|
4354 | 4354 | ]); |
4355 | 4355 | |
4356 | 4356 | return $fieldId; |
@@ -4422,8 +4422,8 @@ discard block |
||
4422 | 4422 | { |
4423 | 4423 | $this->acroFormId = ++$this->numObj; |
4424 | 4424 | $this->o_acroform($this->acroFormId, 'new', [ |
4425 | - 'NeedAppearances' => $needAppearances ? 'true' : 'false', |
|
4426 | - 'SigFlags' => $sigFlags |
|
4425 | + 'NeedAppearances' => $needAppearances ? 'true' : 'false', |
|
4426 | + 'SigFlags' => $sigFlags |
|
4427 | 4427 | ]); |
4428 | 4428 | } |
4429 | 4429 |
@@ -27,24 +27,24 @@ discard block |
||
27 | 27 | const PDF_VERSION = '1.7'; |
28 | 28 | |
29 | 29 | const ACROFORM_SIG_SIGNATURESEXISTS = 0x0001; |
30 | - const ACROFORM_SIG_APPENDONLY = 0x0002; |
|
30 | + const ACROFORM_SIG_APPENDONLY = 0x0002; |
|
31 | 31 | |
32 | - const ACROFORM_FIELD_BUTTON = 'Btn'; |
|
33 | - const ACROFORM_FIELD_TEXT = 'Tx'; |
|
34 | - const ACROFORM_FIELD_CHOICE = 'Ch'; |
|
35 | - const ACROFORM_FIELD_SIG = 'Sig'; |
|
32 | + const ACROFORM_FIELD_BUTTON = 'Btn'; |
|
33 | + const ACROFORM_FIELD_TEXT = 'Tx'; |
|
34 | + const ACROFORM_FIELD_CHOICE = 'Ch'; |
|
35 | + const ACROFORM_FIELD_SIG = 'Sig'; |
|
36 | 36 | |
37 | - const ACROFORM_FIELD_READONLY = 0x0001; |
|
38 | - const ACROFORM_FIELD_REQUIRED = 0x0002; |
|
37 | + const ACROFORM_FIELD_READONLY = 0x0001; |
|
38 | + const ACROFORM_FIELD_REQUIRED = 0x0002; |
|
39 | 39 | |
40 | - const ACROFORM_FIELD_TEXT_MULTILINE = 0x1000; |
|
41 | - const ACROFORM_FIELD_TEXT_PASSWORD = 0x2000; |
|
42 | - const ACROFORM_FIELD_TEXT_RICHTEXT = 0x10000; |
|
40 | + const ACROFORM_FIELD_TEXT_MULTILINE = 0x1000; |
|
41 | + const ACROFORM_FIELD_TEXT_PASSWORD = 0x2000; |
|
42 | + const ACROFORM_FIELD_TEXT_RICHTEXT = 0x10000; |
|
43 | 43 | |
44 | - const ACROFORM_FIELD_CHOICE_COMBO = 0x20000; |
|
45 | - const ACROFORM_FIELD_CHOICE_EDIT = 0x40000; |
|
46 | - const ACROFORM_FIELD_CHOICE_SORT = 0x80000; |
|
47 | - const ACROFORM_FIELD_CHOICE_MULTISELECT = 0x200000; |
|
44 | + const ACROFORM_FIELD_CHOICE_COMBO = 0x20000; |
|
45 | + const ACROFORM_FIELD_CHOICE_EDIT = 0x40000; |
|
46 | + const ACROFORM_FIELD_CHOICE_SORT = 0x80000; |
|
47 | + const ACROFORM_FIELD_CHOICE_MULTISELECT = 0x200000; |
|
48 | 48 | |
49 | 49 | const XOBJECT_SUBTYPE_FORM = 'Form'; |
50 | 50 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | function __construct($pageSize = [0, 0, 612, 792], $isUnicode = false, $fontcache = '', $tmp = '') |
408 | 408 | { |
409 | 409 | $this->isUnicode = $isUnicode; |
410 | - $this->fontcache = rtrim($fontcache, DIRECTORY_SEPARATOR."/\\"); |
|
410 | + $this->fontcache = rtrim($fontcache, DIRECTORY_SEPARATOR . "/\\"); |
|
411 | 411 | $this->tmp = ($tmp !== '' ? $tmp : sys_get_temp_dir()); |
412 | 412 | $this->newDocument($pageSize); |
413 | 413 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | if (is_string($v)) { |
584 | 584 | $v = '/' . $v; |
585 | 585 | } elseif (is_int($v)) { |
586 | - $v = (string) $v; |
|
586 | + $v = (string)$v; |
|
587 | 587 | } elseif (is_bool($v)) { |
588 | 588 | $v = ($v ? 'true' : 'false'); |
589 | 589 | } elseif (is_array($v)) { |
@@ -2196,7 +2196,7 @@ discard block |
||
2196 | 2196 | // make the new object |
2197 | 2197 | $this->objects[$id] = ['t' => 'image', 'data' => &$options['data'], 'info' => []]; |
2198 | 2198 | |
2199 | - $info =& $this->objects[$id]['info']; |
|
2199 | + $info = & $this->objects[$id]['info']; |
|
2200 | 2200 | |
2201 | 2201 | $info['Type'] = '/XObject'; |
2202 | 2202 | $info['Subtype'] = '/Image'; |
@@ -2656,7 +2656,7 @@ discard block |
||
2656 | 2656 | |
2657 | 2657 | case 'byterange': |
2658 | 2658 | $o = &$this->objects[$id]; |
2659 | - $content =& $options['content']; |
|
2659 | + $content = & $options['content']; |
|
2660 | 2660 | $content_len = strlen($content); |
2661 | 2661 | $pos = strpos($content, sprintf("/ByteRange [ %'.010d", $id)); |
2662 | 2662 | $len = strlen('/ByteRange [ ********** ********** ********** ********** ]'); |
@@ -2710,7 +2710,7 @@ discard block |
||
2710 | 2710 | $this->encryptInit($id); |
2711 | 2711 | } |
2712 | 2712 | |
2713 | - $res .= "/ByteRange " .sprintf("[ %'.010d ********** ********** ********** ]\n", $id); |
|
2713 | + $res .= "/ByteRange " . sprintf("[ %'.010d ********** ********** ********** ]\n", $id); |
|
2714 | 2714 | $res .= "/Contents <" . str_pad('', $sign_maxlen, '0') . ">\n"; |
2715 | 2715 | $res .= "/Filter/Adobe.PPKLite\n"; //PPKMS \n"; |
2716 | 2716 | $res .= "/Type/Sig/SubFilter/adbe.pkcs7.detached \n"; |
@@ -4336,7 +4336,7 @@ discard block |
||
4336 | 4336 | $currentFontNum = $this->currentFontNum; |
4337 | 4337 | $font = array_filter( |
4338 | 4338 | $this->objects[$this->currentNode]['info']['fonts'], |
4339 | - function ($item) use ($currentFontNum) { return $item['fontNum'] == $currentFontNum; } |
|
4339 | + function($item) use ($currentFontNum) { return $item['fontNum'] == $currentFontNum; } |
|
4340 | 4340 | ); |
4341 | 4341 | |
4342 | 4342 | $this->o_acroform($this->acroFormId, 'font', |
@@ -5508,7 +5508,7 @@ discard block |
||
5508 | 5508 | // else assume that they are both scalar, anything else will probably error |
5509 | 5509 | if (is_array($label)) { |
5510 | 5510 | foreach ($label as $l => $v) { |
5511 | - $this->o_info($this->infoObject, $l, (string) $v); |
|
5511 | + $this->o_info($this->infoObject, $l, (string)$v); |
|
5512 | 5512 | } |
5513 | 5513 | } else { |
5514 | 5514 | $this->o_info($this->infoObject, $label, $value); |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | if (!isset(self::$_defaults)) { |
638 | 638 | |
639 | 639 | // Shorthand |
640 | - $d =& self::$_defaults; |
|
640 | + $d = & self::$_defaults; |
|
641 | 641 | |
642 | 642 | // All CSS 2.1 properties, and their default values |
643 | 643 | // Some properties are specified with their computed value for |
@@ -977,11 +977,11 @@ discard block |
||
977 | 977 | |
978 | 978 | // Assume numeric values are already in points |
979 | 979 | if (is_numeric($l)) { |
980 | - $ret += (float) $l; |
|
980 | + $ret += (float)$l; |
|
981 | 981 | continue; |
982 | 982 | } |
983 | 983 | |
984 | - $val = $this->single_length_in_pt((string) $l, $ref_size, $font_size); |
|
984 | + $val = $this->single_length_in_pt((string)$l, $ref_size, $font_size); |
|
985 | 985 | $ret += $val ?? 0; |
986 | 986 | } |
987 | 987 | |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | return null; |
1017 | 1017 | } |
1018 | 1018 | |
1019 | - $v = (float) $matches[1]; |
|
1019 | + $v = (float)$matches[1]; |
|
1020 | 1020 | $unit = mb_strtolower($matches[2]); |
1021 | 1021 | |
1022 | 1022 | if ($unit === "") { |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | if (self::$_methods_cache[$method]) { |
1462 | 1462 | return $this->$method(); |
1463 | 1463 | } else { |
1464 | - return implode(" ", array_map(function ($sub_prop) { |
|
1464 | + return implode(" ", array_map(function($sub_prop) { |
|
1465 | 1465 | $val = $this->__get($sub_prop); |
1466 | 1466 | return \is_array($val) ? implode(" ", $val) : $val; |
1467 | 1467 | }, self::$_props_shorthand[$prop])); |
@@ -1698,7 +1698,7 @@ discard block |
||
1698 | 1698 | $font_size = $this->__get("font_size"); |
1699 | 1699 | $factor = $computed === "normal" |
1700 | 1700 | ? self::$default_line_height |
1701 | - : (float) $computed; |
|
1701 | + : (float)$computed; |
|
1702 | 1702 | |
1703 | 1703 | return $factor * $font_size; |
1704 | 1704 | } |
@@ -1917,10 +1917,10 @@ discard block |
||
1917 | 1917 | // Use a fixed ref size here. We don't know the border-box width here |
1918 | 1918 | // and font size might be 0. Since we are only interested in whether |
1919 | 1919 | // there is any border radius at all, this should do |
1920 | - $tl = (float) $this->length_in_pt($this->border_top_left_radius, 12); |
|
1921 | - $tr = (float) $this->length_in_pt($this->border_top_right_radius, 12); |
|
1922 | - $br = (float) $this->length_in_pt($this->border_bottom_right_radius, 12); |
|
1923 | - $bl = (float) $this->length_in_pt($this->border_bottom_left_radius, 12); |
|
1920 | + $tl = (float)$this->length_in_pt($this->border_top_left_radius, 12); |
|
1921 | + $tr = (float)$this->length_in_pt($this->border_top_right_radius, 12); |
|
1922 | + $br = (float)$this->length_in_pt($this->border_bottom_right_radius, 12); |
|
1923 | + $bl = (float)$this->length_in_pt($this->border_bottom_left_radius, 12); |
|
1924 | 1924 | |
1925 | 1925 | $this->has_border_radius_cache = $tl + $tr + $br + $bl > 0; |
1926 | 1926 | return $this->has_border_radius_cache; |
@@ -1953,10 +1953,10 @@ discard block |
||
1953 | 1953 | |
1954 | 1954 | // Resolve percentages relative to width, as long as we have no support |
1955 | 1955 | // for per-axis radii |
1956 | - $tl = (float) $this->length_in_pt($this->border_top_left_radius, $w); |
|
1957 | - $tr = (float) $this->length_in_pt($this->border_top_right_radius, $w); |
|
1958 | - $br = (float) $this->length_in_pt($this->border_bottom_right_radius, $w); |
|
1959 | - $bl = (float) $this->length_in_pt($this->border_bottom_left_radius, $w); |
|
1956 | + $tl = (float)$this->length_in_pt($this->border_top_left_radius, $w); |
|
1957 | + $tr = (float)$this->length_in_pt($this->border_top_right_radius, $w); |
|
1958 | + $br = (float)$this->length_in_pt($this->border_bottom_right_radius, $w); |
|
1959 | + $bl = (float)$this->length_in_pt($this->border_bottom_left_radius, $w); |
|
1960 | 1960 | |
1961 | 1961 | if ($tl + $tr + $br + $bl > 0) { |
1962 | 1962 | [$rx, $ry, $rw, $rh] = $render_box; |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | |
2090 | 2090 | foreach ($matches as $match) { |
2091 | 2091 | $counter = $match[1]; |
2092 | - $value = isset($match[2]) ? (int) $match[2] : $default; |
|
2092 | + $value = isset($match[2]) ? (int)$match[2] : $default; |
|
2093 | 2093 | $counters[$counter] = $value; |
2094 | 2094 | } |
2095 | 2095 | |
@@ -2206,7 +2206,7 @@ discard block |
||
2206 | 2206 | { |
2207 | 2207 | $integer = self::CSS_INTEGER; |
2208 | 2208 | return preg_match("/^$integer$/", $val) |
2209 | - ? (int) $val |
|
2209 | + ? (int)$val |
|
2210 | 2210 | : null; |
2211 | 2211 | } |
2212 | 2212 | |
@@ -2802,7 +2802,7 @@ discard block |
||
2802 | 2802 | |
2803 | 2803 | // Compute number values to string and lengths to float (in pt) |
2804 | 2804 | if (is_numeric($val)) { |
2805 | - return (string) $val; |
|
2805 | + return (string)$val; |
|
2806 | 2806 | } |
2807 | 2807 | |
2808 | 2808 | $font_size = $this->__get("font_size"); |
@@ -3492,9 +3492,9 @@ discard block |
||
3492 | 3492 | |
3493 | 3493 | foreach ($values as $i => $value) { |
3494 | 3494 | if (strpos($value, "rad")) { |
3495 | - $values[$i] = rad2deg((float) $value); |
|
3495 | + $values[$i] = rad2deg((float)$value); |
|
3496 | 3496 | } else { |
3497 | - $values[$i] = (float) $value; |
|
3497 | + $values[$i] = (float)$value; |
|
3498 | 3498 | } |
3499 | 3499 | } |
3500 | 3500 | |
@@ -3577,7 +3577,7 @@ discard block |
||
3577 | 3577 | |
3578 | 3578 | $values = preg_split("/\s+/", $computed); |
3579 | 3579 | |
3580 | - $values = array_map(function ($value) { |
|
3580 | + $values = array_map(function($value) { |
|
3581 | 3581 | if (\in_array($value, ["top", "left"], true)) { |
3582 | 3582 | return 0; |
3583 | 3583 | } elseif (\in_array($value, ["bottom", "right"], true)) { |
@@ -3656,7 +3656,7 @@ discard block |
||
3656 | 3656 | return null; |
3657 | 3657 | } |
3658 | 3658 | |
3659 | - $v = (float) $matches[1]; |
|
3659 | + $v = (float)$matches[1]; |
|
3660 | 3660 | $percent = $matches[2] === "%"; |
3661 | 3661 | $opacity = $percent ? ($v / 100) : $v; |
3662 | 3662 |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // #rgba format |
210 | 210 | if ($length === 5) { |
211 | 211 | if (ctype_xdigit($color[4])) { |
212 | - $alpha = round(hexdec($color[4] . $color[4])/255, 2); |
|
212 | + $alpha = round(hexdec($color[4] . $color[4]) / 255, 2); |
|
213 | 213 | } |
214 | 214 | return $cache[$color] = self::getArray($color[1] . $color[1] . $color[2] . $color[2] . $color[3] . $color[3], $alpha); |
215 | 215 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // #rrggbbaa format |
223 | 223 | if ($length === 9) { |
224 | 224 | if (ctype_xdigit(mb_substr($color, 7, 2))) { |
225 | - $alpha = round(hexdec(mb_substr($color, 7, 2))/255, 2); |
|
225 | + $alpha = round(hexdec(mb_substr($color, 7, 2)) / 255, 2); |
|
226 | 226 | } |
227 | 227 | return $cache[$color] = self::getArray(mb_substr($color, 1, 6), $alpha); |
228 | 228 | } |
@@ -261,16 +261,16 @@ discard block |
||
261 | 261 | |
262 | 262 | // Parse alpha value |
263 | 263 | if (Helpers::is_percent($alpha)) { |
264 | - $alpha = (float) $alpha / 100; |
|
264 | + $alpha = (float)$alpha / 100; |
|
265 | 265 | } else { |
266 | - $alpha = (float) $alpha; |
|
266 | + $alpha = (float)$alpha; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | $alpha = max(0.0, min($alpha, 1.0)); |
270 | 270 | |
271 | 271 | foreach ($triplet as &$c) { |
272 | 272 | if (Helpers::is_percent($c)) { |
273 | - $c = round((float) $c * 2.55); |
|
273 | + $c = round((float)$c * 2.55); |
|
274 | 274 | } |
275 | 275 | } |
276 | 276 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | return null; |
295 | 295 | } |
296 | 296 | |
297 | - $values = array_map(function ($c) { |
|
297 | + $values = array_map(function($c) { |
|
298 | 298 | return min(1.0, max(0.0, floatval(trim($c)))); |
299 | 299 | }, $values); |
300 | 300 |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | unlink($localTempFile); |
249 | 249 | |
250 | - if ( !file_exists("$localFilePath.ufm") ) { |
|
250 | + if (!file_exists("$localFilePath.ufm")) { |
|
251 | 251 | return false; |
252 | 252 | } |
253 | 253 | |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | // Save the changes |
263 | - file_put_contents($localFilePath.$fontExtension, $remoteFileContent); |
|
263 | + file_put_contents($localFilePath . $fontExtension, $remoteFileContent); |
|
264 | 264 | |
265 | - if ( !file_exists($localFilePath.$fontExtension) ) { |
|
265 | + if (!file_exists($localFilePath . $fontExtension)) { |
|
266 | 266 | unlink("$localFilePath.ufm"); |
267 | 267 | return false; |
268 | 268 | } |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | |
514 | 514 | return $style === null |
515 | 515 | ? $weight |
516 | - : $weight.'_'.$style; |
|
516 | + : $weight . '_' . $style; |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | /** |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | if (isset($this->bundledFonts) && is_array($this->bundledFonts)) { |
550 | 550 | foreach ($this->bundledFonts as $family => $variants) { |
551 | 551 | if (!isset($fontFamilies[$family])) { |
552 | - $fontFamilies[$family] = array_map(function ($variant) { |
|
552 | + $fontFamilies[$family] = array_map(function($variant) { |
|
553 | 553 | return $this->getOptions()->getRootDir() . '/lib/fonts/' . $variant; |
554 | 554 | }, $variants); |
555 | 555 | } |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | } |
558 | 558 | if (isset($this->userFonts) && is_array($this->userFonts)) { |
559 | 559 | foreach ($this->userFonts as $family => $variants) { |
560 | - $fontFamilies[$family] = array_map(function ($variant) { |
|
560 | + $fontFamilies[$family] = array_map(function($variant) { |
|
561 | 561 | $variantName = basename($variant); |
562 | 562 | if ($variantName === $variant) { |
563 | 563 | return $this->getOptions()->getFontDir() . '/' . $variant; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | // Determine the frame width including margin, padding & border |
147 | 147 | $visible_text = preg_replace('/\xAD/u', "", $text); |
148 | 148 | $text_width = $fontMetrics->getTextWidth($visible_text, $font, $size, $word_spacing, $letter_spacing); |
149 | - $mbp_width = (float) $style->length_in_pt([ |
|
149 | + $mbp_width = (float)$style->length_in_pt([ |
|
150 | 150 | $style->margin_left, |
151 | 151 | $style->border_left_width, |
152 | 152 | $style->padding_left, |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | } else { |
517 | 517 | // Find the longest word |
518 | 518 | $words = preg_split(self::$_wordbreak_pattern, $text, -1, PREG_SPLIT_DELIM_CAPTURE); |
519 | - $lengths = array_map(function ($chunk) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
519 | + $lengths = array_map(function($chunk) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
520 | 520 | // Allow trailing white space to overflow. As in actual |
521 | 521 | // layout above, only handle a single space for now |
522 | 522 | $sep = $chunk[1] ?? ""; |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | case "pre": |
531 | 531 | // Find the longest line |
532 | 532 | $lines = array_flip(preg_split("/\R/u", $visible_text)); |
533 | - array_walk($lines, function (&$chunked_text_width, $chunked_text) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
533 | + array_walk($lines, function(&$chunked_text_width, $chunked_text) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
534 | 534 | $chunked_text_width = $fontMetrics->getTextWidth($chunked_text, $font, $size, $word_spacing, $letter_spacing); |
535 | 535 | }); |
536 | 536 | arsort($lines); |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | case "pre-wrap": |
554 | 554 | // Find the longest line |
555 | 555 | $lines = array_flip(preg_split("/\R/u", $visible_text)); |
556 | - array_walk($lines, function (&$chunked_text_width, $chunked_text) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
556 | + array_walk($lines, function(&$chunked_text_width, $chunked_text) use ($fontMetrics, $font, $size, $word_spacing, $letter_spacing) { |
|
557 | 557 | $chunked_text_width = $fontMetrics->getTextWidth($chunked_text, $font, $size, $word_spacing, $letter_spacing); |
558 | 558 | }); |
559 | 559 | arsort($lines); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | ]; |
578 | 578 | |
579 | 579 | // The containing block is not defined yet, treat percentages as 0 |
580 | - $delta = (float) $style->length_in_pt($dims, 0); |
|
580 | + $delta = (float)$style->length_in_pt($dims, 0); |
|
581 | 581 | $min += $delta; |
582 | 582 | $max += $delta; |
583 | 583 |