@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | function ps_add_launchlink($psdoc, float $llx, float $lly, float $urx, float $ury, string $filename): void |
| 29 | 29 | { |
| 30 | - error_clear_last(); |
|
| 31 | - $result = \ps_add_launchlink($psdoc, $llx, $lly, $urx, $ury, $filename); |
|
| 32 | - if ($result === false) { |
|
| 33 | - throw PsException::createFromPhpError(); |
|
| 34 | - } |
|
| 30 | + error_clear_last(); |
|
| 31 | + $result = \ps_add_launchlink($psdoc, $llx, $lly, $urx, $ury, $filename); |
|
| 32 | + if ($result === false) { |
|
| 33 | + throw PsException::createFromPhpError(); |
|
| 34 | + } |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | function ps_add_locallink($psdoc, float $llx, float $lly, float $urx, float $ury, int $page, string $dest): void |
| 67 | 67 | { |
| 68 | - error_clear_last(); |
|
| 69 | - $result = \ps_add_locallink($psdoc, $llx, $lly, $urx, $ury, $page, $dest); |
|
| 70 | - if ($result === false) { |
|
| 71 | - throw PsException::createFromPhpError(); |
|
| 72 | - } |
|
| 68 | + error_clear_last(); |
|
| 69 | + $result = \ps_add_locallink($psdoc, $llx, $lly, $urx, $ury, $page, $dest); |
|
| 70 | + if ($result === false) { |
|
| 71 | + throw PsException::createFromPhpError(); |
|
| 72 | + } |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | function ps_add_note($psdoc, float $llx, float $lly, float $urx, float $ury, string $contents, string $title, string $icon, int $open): void |
| 106 | 106 | { |
| 107 | - error_clear_last(); |
|
| 108 | - $result = \ps_add_note($psdoc, $llx, $lly, $urx, $ury, $contents, $title, $icon, $open); |
|
| 109 | - if ($result === false) { |
|
| 110 | - throw PsException::createFromPhpError(); |
|
| 111 | - } |
|
| 107 | + error_clear_last(); |
|
| 108 | + $result = \ps_add_note($psdoc, $llx, $lly, $urx, $ury, $contents, $title, $icon, $open); |
|
| 109 | + if ($result === false) { |
|
| 110 | + throw PsException::createFromPhpError(); |
|
| 111 | + } |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | function ps_add_pdflink($psdoc, float $llx, float $lly, float $urx, float $ury, string $filename, int $page, string $dest): void |
| 146 | 146 | { |
| 147 | - error_clear_last(); |
|
| 148 | - $result = \ps_add_pdflink($psdoc, $llx, $lly, $urx, $ury, $filename, $page, $dest); |
|
| 149 | - if ($result === false) { |
|
| 150 | - throw PsException::createFromPhpError(); |
|
| 151 | - } |
|
| 147 | + error_clear_last(); |
|
| 148 | + $result = \ps_add_pdflink($psdoc, $llx, $lly, $urx, $ury, $filename, $page, $dest); |
|
| 149 | + if ($result === false) { |
|
| 150 | + throw PsException::createFromPhpError(); |
|
| 151 | + } |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | function ps_add_weblink($psdoc, float $llx, float $lly, float $urx, float $ury, string $url): void |
| 179 | 179 | { |
| 180 | - error_clear_last(); |
|
| 181 | - $result = \ps_add_weblink($psdoc, $llx, $lly, $urx, $ury, $url); |
|
| 182 | - if ($result === false) { |
|
| 183 | - throw PsException::createFromPhpError(); |
|
| 184 | - } |
|
| 180 | + error_clear_last(); |
|
| 181 | + $result = \ps_add_weblink($psdoc, $llx, $lly, $urx, $ury, $url); |
|
| 182 | + if ($result === false) { |
|
| 183 | + throw PsException::createFromPhpError(); |
|
| 184 | + } |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
@@ -206,11 +206,11 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | function ps_arc($psdoc, float $x, float $y, float $radius, float $alpha, float $beta): void |
| 208 | 208 | { |
| 209 | - error_clear_last(); |
|
| 210 | - $result = \ps_arc($psdoc, $x, $y, $radius, $alpha, $beta); |
|
| 211 | - if ($result === false) { |
|
| 212 | - throw PsException::createFromPhpError(); |
|
| 213 | - } |
|
| 209 | + error_clear_last(); |
|
| 210 | + $result = \ps_arc($psdoc, $x, $y, $radius, $alpha, $beta); |
|
| 211 | + if ($result === false) { |
|
| 212 | + throw PsException::createFromPhpError(); |
|
| 213 | + } |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | function ps_arcn($psdoc, float $x, float $y, float $radius, float $alpha, float $beta): void |
| 237 | 237 | { |
| 238 | - error_clear_last(); |
|
| 239 | - $result = \ps_arcn($psdoc, $x, $y, $radius, $alpha, $beta); |
|
| 240 | - if ($result === false) { |
|
| 241 | - throw PsException::createFromPhpError(); |
|
| 242 | - } |
|
| 238 | + error_clear_last(); |
|
| 239 | + $result = \ps_arcn($psdoc, $x, $y, $radius, $alpha, $beta); |
|
| 240 | + if ($result === false) { |
|
| 241 | + throw PsException::createFromPhpError(); |
|
| 242 | + } |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
@@ -286,11 +286,11 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | function ps_begin_page($psdoc, float $width, float $height): void |
| 288 | 288 | { |
| 289 | - error_clear_last(); |
|
| 290 | - $result = \ps_begin_page($psdoc, $width, $height); |
|
| 291 | - if ($result === false) { |
|
| 292 | - throw PsException::createFromPhpError(); |
|
| 293 | - } |
|
| 289 | + error_clear_last(); |
|
| 290 | + $result = \ps_begin_page($psdoc, $width, $height); |
|
| 291 | + if ($result === false) { |
|
| 292 | + throw PsException::createFromPhpError(); |
|
| 293 | + } |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
@@ -315,12 +315,12 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | function ps_begin_pattern($psdoc, float $width, float $height, float $xstep, float $ystep, int $painttype): int |
| 317 | 317 | { |
| 318 | - error_clear_last(); |
|
| 319 | - $result = \ps_begin_pattern($psdoc, $width, $height, $xstep, $ystep, $painttype); |
|
| 320 | - if ($result === false) { |
|
| 321 | - throw PsException::createFromPhpError(); |
|
| 322 | - } |
|
| 323 | - return $result; |
|
| 318 | + error_clear_last(); |
|
| 319 | + $result = \ps_begin_pattern($psdoc, $width, $height, $xstep, $ystep, $painttype); |
|
| 320 | + if ($result === false) { |
|
| 321 | + throw PsException::createFromPhpError(); |
|
| 322 | + } |
|
| 323 | + return $result; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
@@ -342,12 +342,12 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | function ps_begin_template($psdoc, float $width, float $height): int |
| 344 | 344 | { |
| 345 | - error_clear_last(); |
|
| 346 | - $result = \ps_begin_template($psdoc, $width, $height); |
|
| 347 | - if ($result === false) { |
|
| 348 | - throw PsException::createFromPhpError(); |
|
| 349 | - } |
|
| 350 | - return $result; |
|
| 345 | + error_clear_last(); |
|
| 346 | + $result = \ps_begin_template($psdoc, $width, $height); |
|
| 347 | + if ($result === false) { |
|
| 348 | + throw PsException::createFromPhpError(); |
|
| 349 | + } |
|
| 350 | + return $result; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | |
@@ -371,11 +371,11 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | function ps_circle($psdoc, float $x, float $y, float $radius): void |
| 373 | 373 | { |
| 374 | - error_clear_last(); |
|
| 375 | - $result = \ps_circle($psdoc, $x, $y, $radius); |
|
| 376 | - if ($result === false) { |
|
| 377 | - throw PsException::createFromPhpError(); |
|
| 378 | - } |
|
| 374 | + error_clear_last(); |
|
| 375 | + $result = \ps_circle($psdoc, $x, $y, $radius); |
|
| 376 | + if ($result === false) { |
|
| 377 | + throw PsException::createFromPhpError(); |
|
| 378 | + } |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | |
@@ -390,11 +390,11 @@ discard block |
||
| 390 | 390 | */ |
| 391 | 391 | function ps_clip($psdoc): void |
| 392 | 392 | { |
| 393 | - error_clear_last(); |
|
| 394 | - $result = \ps_clip($psdoc); |
|
| 395 | - if ($result === false) { |
|
| 396 | - throw PsException::createFromPhpError(); |
|
| 397 | - } |
|
| 393 | + error_clear_last(); |
|
| 394 | + $result = \ps_clip($psdoc); |
|
| 395 | + if ($result === false) { |
|
| 396 | + throw PsException::createFromPhpError(); |
|
| 397 | + } |
|
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | |
@@ -412,11 +412,11 @@ discard block |
||
| 412 | 412 | */ |
| 413 | 413 | function ps_close_image($psdoc, int $imageid): void |
| 414 | 414 | { |
| 415 | - error_clear_last(); |
|
| 416 | - $result = \ps_close_image($psdoc, $imageid); |
|
| 417 | - if ($result === false) { |
|
| 418 | - throw PsException::createFromPhpError(); |
|
| 419 | - } |
|
| 415 | + error_clear_last(); |
|
| 416 | + $result = \ps_close_image($psdoc, $imageid); |
|
| 417 | + if ($result === false) { |
|
| 418 | + throw PsException::createFromPhpError(); |
|
| 419 | + } |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | */ |
| 438 | 438 | function ps_close($psdoc): void |
| 439 | 439 | { |
| 440 | - error_clear_last(); |
|
| 441 | - $result = \ps_close($psdoc); |
|
| 442 | - if ($result === false) { |
|
| 443 | - throw PsException::createFromPhpError(); |
|
| 444 | - } |
|
| 440 | + error_clear_last(); |
|
| 441 | + $result = \ps_close($psdoc); |
|
| 442 | + if ($result === false) { |
|
| 443 | + throw PsException::createFromPhpError(); |
|
| 444 | + } |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -456,11 +456,11 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function ps_closepath_stroke($psdoc): void |
| 458 | 458 | { |
| 459 | - error_clear_last(); |
|
| 460 | - $result = \ps_closepath_stroke($psdoc); |
|
| 461 | - if ($result === false) { |
|
| 462 | - throw PsException::createFromPhpError(); |
|
| 463 | - } |
|
| 459 | + error_clear_last(); |
|
| 460 | + $result = \ps_closepath_stroke($psdoc); |
|
| 461 | + if ($result === false) { |
|
| 462 | + throw PsException::createFromPhpError(); |
|
| 463 | + } |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | |
@@ -475,11 +475,11 @@ discard block |
||
| 475 | 475 | */ |
| 476 | 476 | function ps_closepath($psdoc): void |
| 477 | 477 | { |
| 478 | - error_clear_last(); |
|
| 479 | - $result = \ps_closepath($psdoc); |
|
| 480 | - if ($result === false) { |
|
| 481 | - throw PsException::createFromPhpError(); |
|
| 482 | - } |
|
| 478 | + error_clear_last(); |
|
| 479 | + $result = \ps_closepath($psdoc); |
|
| 480 | + if ($result === false) { |
|
| 481 | + throw PsException::createFromPhpError(); |
|
| 482 | + } |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | |
@@ -498,11 +498,11 @@ discard block |
||
| 498 | 498 | */ |
| 499 | 499 | function ps_continue_text($psdoc, string $text): void |
| 500 | 500 | { |
| 501 | - error_clear_last(); |
|
| 502 | - $result = \ps_continue_text($psdoc, $text); |
|
| 503 | - if ($result === false) { |
|
| 504 | - throw PsException::createFromPhpError(); |
|
| 505 | - } |
|
| 501 | + error_clear_last(); |
|
| 502 | + $result = \ps_continue_text($psdoc, $text); |
|
| 503 | + if ($result === false) { |
|
| 504 | + throw PsException::createFromPhpError(); |
|
| 505 | + } |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | |
@@ -523,11 +523,11 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | function ps_curveto($psdoc, float $x1, float $y1, float $x2, float $y2, float $x3, float $y3): void |
| 525 | 525 | { |
| 526 | - error_clear_last(); |
|
| 527 | - $result = \ps_curveto($psdoc, $x1, $y1, $x2, $y2, $x3, $y3); |
|
| 528 | - if ($result === false) { |
|
| 529 | - throw PsException::createFromPhpError(); |
|
| 530 | - } |
|
| 526 | + error_clear_last(); |
|
| 527 | + $result = \ps_curveto($psdoc, $x1, $y1, $x2, $y2, $x3, $y3); |
|
| 528 | + if ($result === false) { |
|
| 529 | + throw PsException::createFromPhpError(); |
|
| 530 | + } |
|
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | |
@@ -546,11 +546,11 @@ discard block |
||
| 546 | 546 | */ |
| 547 | 547 | function ps_delete($psdoc): void |
| 548 | 548 | { |
| 549 | - error_clear_last(); |
|
| 550 | - $result = \ps_delete($psdoc); |
|
| 551 | - if ($result === false) { |
|
| 552 | - throw PsException::createFromPhpError(); |
|
| 553 | - } |
|
| 549 | + error_clear_last(); |
|
| 550 | + $result = \ps_delete($psdoc); |
|
| 551 | + if ($result === false) { |
|
| 552 | + throw PsException::createFromPhpError(); |
|
| 553 | + } |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | |
@@ -567,11 +567,11 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | function ps_end_page($psdoc): void |
| 569 | 569 | { |
| 570 | - error_clear_last(); |
|
| 571 | - $result = \ps_end_page($psdoc); |
|
| 572 | - if ($result === false) { |
|
| 573 | - throw PsException::createFromPhpError(); |
|
| 574 | - } |
|
| 570 | + error_clear_last(); |
|
| 571 | + $result = \ps_end_page($psdoc); |
|
| 572 | + if ($result === false) { |
|
| 573 | + throw PsException::createFromPhpError(); |
|
| 574 | + } |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | |
@@ -587,11 +587,11 @@ discard block |
||
| 587 | 587 | */ |
| 588 | 588 | function ps_end_pattern($psdoc): void |
| 589 | 589 | { |
| 590 | - error_clear_last(); |
|
| 591 | - $result = \ps_end_pattern($psdoc); |
|
| 592 | - if ($result === false) { |
|
| 593 | - throw PsException::createFromPhpError(); |
|
| 594 | - } |
|
| 590 | + error_clear_last(); |
|
| 591 | + $result = \ps_end_pattern($psdoc); |
|
| 592 | + if ($result === false) { |
|
| 593 | + throw PsException::createFromPhpError(); |
|
| 594 | + } |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | |
@@ -606,11 +606,11 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | function ps_end_template($psdoc): void |
| 608 | 608 | { |
| 609 | - error_clear_last(); |
|
| 610 | - $result = \ps_end_template($psdoc); |
|
| 611 | - if ($result === false) { |
|
| 612 | - throw PsException::createFromPhpError(); |
|
| 613 | - } |
|
| 609 | + error_clear_last(); |
|
| 610 | + $result = \ps_end_template($psdoc); |
|
| 611 | + if ($result === false) { |
|
| 612 | + throw PsException::createFromPhpError(); |
|
| 613 | + } |
|
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | |
@@ -625,11 +625,11 @@ discard block |
||
| 625 | 625 | */ |
| 626 | 626 | function ps_fill_stroke($psdoc): void |
| 627 | 627 | { |
| 628 | - error_clear_last(); |
|
| 629 | - $result = \ps_fill_stroke($psdoc); |
|
| 630 | - if ($result === false) { |
|
| 631 | - throw PsException::createFromPhpError(); |
|
| 632 | - } |
|
| 628 | + error_clear_last(); |
|
| 629 | + $result = \ps_fill_stroke($psdoc); |
|
| 630 | + if ($result === false) { |
|
| 631 | + throw PsException::createFromPhpError(); |
|
| 632 | + } |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | |
@@ -644,11 +644,11 @@ discard block |
||
| 644 | 644 | */ |
| 645 | 645 | function ps_fill($psdoc): void |
| 646 | 646 | { |
| 647 | - error_clear_last(); |
|
| 648 | - $result = \ps_fill($psdoc); |
|
| 649 | - if ($result === false) { |
|
| 650 | - throw PsException::createFromPhpError(); |
|
| 651 | - } |
|
| 647 | + error_clear_last(); |
|
| 648 | + $result = \ps_fill($psdoc); |
|
| 649 | + if ($result === false) { |
|
| 650 | + throw PsException::createFromPhpError(); |
|
| 651 | + } |
|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | |
@@ -780,16 +780,16 @@ discard block |
||
| 780 | 780 | */ |
| 781 | 781 | function ps_get_parameter($psdoc, string $name, float $modifier = null): string |
| 782 | 782 | { |
| 783 | - error_clear_last(); |
|
| 784 | - if ($modifier !== null) { |
|
| 785 | - $result = \ps_get_parameter($psdoc, $name, $modifier); |
|
| 786 | - } else { |
|
| 787 | - $result = \ps_get_parameter($psdoc, $name); |
|
| 788 | - } |
|
| 789 | - if ($result === false) { |
|
| 790 | - throw PsException::createFromPhpError(); |
|
| 791 | - } |
|
| 792 | - return $result; |
|
| 783 | + error_clear_last(); |
|
| 784 | + if ($modifier !== null) { |
|
| 785 | + $result = \ps_get_parameter($psdoc, $name, $modifier); |
|
| 786 | + } else { |
|
| 787 | + $result = \ps_get_parameter($psdoc, $name); |
|
| 788 | + } |
|
| 789 | + if ($result === false) { |
|
| 790 | + throw PsException::createFromPhpError(); |
|
| 791 | + } |
|
| 792 | + return $result; |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | |
@@ -816,12 +816,12 @@ discard block |
||
| 816 | 816 | */ |
| 817 | 817 | function ps_hyphenate($psdoc, string $text): array |
| 818 | 818 | { |
| 819 | - error_clear_last(); |
|
| 820 | - $result = \ps_hyphenate($psdoc, $text); |
|
| 821 | - if ($result === false) { |
|
| 822 | - throw PsException::createFromPhpError(); |
|
| 823 | - } |
|
| 824 | - return $result; |
|
| 819 | + error_clear_last(); |
|
| 820 | + $result = \ps_hyphenate($psdoc, $text); |
|
| 821 | + if ($result === false) { |
|
| 822 | + throw PsException::createFromPhpError(); |
|
| 823 | + } |
|
| 824 | + return $result; |
|
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | |
@@ -838,11 +838,11 @@ discard block |
||
| 838 | 838 | */ |
| 839 | 839 | function ps_include_file($psdoc, string $file): void |
| 840 | 840 | { |
| 841 | - error_clear_last(); |
|
| 842 | - $result = \ps_include_file($psdoc, $file); |
|
| 843 | - if ($result === false) { |
|
| 844 | - throw PsException::createFromPhpError(); |
|
| 845 | - } |
|
| 841 | + error_clear_last(); |
|
| 842 | + $result = \ps_include_file($psdoc, $file); |
|
| 843 | + if ($result === false) { |
|
| 844 | + throw PsException::createFromPhpError(); |
|
| 845 | + } |
|
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | |
@@ -860,11 +860,11 @@ discard block |
||
| 860 | 860 | */ |
| 861 | 861 | function ps_lineto($psdoc, float $x, float $y): void |
| 862 | 862 | { |
| 863 | - error_clear_last(); |
|
| 864 | - $result = \ps_lineto($psdoc, $x, $y); |
|
| 865 | - if ($result === false) { |
|
| 866 | - throw PsException::createFromPhpError(); |
|
| 867 | - } |
|
| 863 | + error_clear_last(); |
|
| 864 | + $result = \ps_lineto($psdoc, $x, $y); |
|
| 865 | + if ($result === false) { |
|
| 866 | + throw PsException::createFromPhpError(); |
|
| 867 | + } |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | |
@@ -883,11 +883,11 @@ discard block |
||
| 883 | 883 | */ |
| 884 | 884 | function ps_moveto($psdoc, float $x, float $y): void |
| 885 | 885 | { |
| 886 | - error_clear_last(); |
|
| 887 | - $result = \ps_moveto($psdoc, $x, $y); |
|
| 888 | - if ($result === false) { |
|
| 889 | - throw PsException::createFromPhpError(); |
|
| 890 | - } |
|
| 886 | + error_clear_last(); |
|
| 887 | + $result = \ps_moveto($psdoc, $x, $y); |
|
| 888 | + if ($result === false) { |
|
| 889 | + throw PsException::createFromPhpError(); |
|
| 890 | + } |
|
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | |
@@ -904,12 +904,12 @@ discard block |
||
| 904 | 904 | */ |
| 905 | 905 | function ps_new() |
| 906 | 906 | { |
| 907 | - error_clear_last(); |
|
| 908 | - $result = \ps_new(); |
|
| 909 | - if ($result === false) { |
|
| 910 | - throw PsException::createFromPhpError(); |
|
| 911 | - } |
|
| 912 | - return $result; |
|
| 907 | + error_clear_last(); |
|
| 908 | + $result = \ps_new(); |
|
| 909 | + if ($result === false) { |
|
| 910 | + throw PsException::createFromPhpError(); |
|
| 911 | + } |
|
| 912 | + return $result; |
|
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | |
@@ -927,15 +927,15 @@ discard block |
||
| 927 | 927 | */ |
| 928 | 928 | function ps_open_file($psdoc, string $filename = null): void |
| 929 | 929 | { |
| 930 | - error_clear_last(); |
|
| 931 | - if ($filename !== null) { |
|
| 932 | - $result = \ps_open_file($psdoc, $filename); |
|
| 933 | - } else { |
|
| 934 | - $result = \ps_open_file($psdoc); |
|
| 935 | - } |
|
| 936 | - if ($result === false) { |
|
| 937 | - throw PsException::createFromPhpError(); |
|
| 938 | - } |
|
| 930 | + error_clear_last(); |
|
| 931 | + if ($filename !== null) { |
|
| 932 | + $result = \ps_open_file($psdoc, $filename); |
|
| 933 | + } else { |
|
| 934 | + $result = \ps_open_file($psdoc); |
|
| 935 | + } |
|
| 936 | + if ($result === false) { |
|
| 937 | + throw PsException::createFromPhpError(); |
|
| 938 | + } |
|
| 939 | 939 | } |
| 940 | 940 | |
| 941 | 941 | |
@@ -959,11 +959,11 @@ discard block |
||
| 959 | 959 | */ |
| 960 | 960 | function ps_place_image($psdoc, int $imageid, float $x, float $y, float $scale): void |
| 961 | 961 | { |
| 962 | - error_clear_last(); |
|
| 963 | - $result = \ps_place_image($psdoc, $imageid, $x, $y, $scale); |
|
| 964 | - if ($result === false) { |
|
| 965 | - throw PsException::createFromPhpError(); |
|
| 966 | - } |
|
| 962 | + error_clear_last(); |
|
| 963 | + $result = \ps_place_image($psdoc, $imageid, $x, $y, $scale); |
|
| 964 | + if ($result === false) { |
|
| 965 | + throw PsException::createFromPhpError(); |
|
| 966 | + } |
|
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | |
@@ -986,11 +986,11 @@ discard block |
||
| 986 | 986 | */ |
| 987 | 987 | function ps_rect($psdoc, float $x, float $y, float $width, float $height): void |
| 988 | 988 | { |
| 989 | - error_clear_last(); |
|
| 990 | - $result = \ps_rect($psdoc, $x, $y, $width, $height); |
|
| 991 | - if ($result === false) { |
|
| 992 | - throw PsException::createFromPhpError(); |
|
| 993 | - } |
|
| 989 | + error_clear_last(); |
|
| 990 | + $result = \ps_rect($psdoc, $x, $y, $width, $height); |
|
| 991 | + if ($result === false) { |
|
| 992 | + throw PsException::createFromPhpError(); |
|
| 993 | + } |
|
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | |
@@ -1008,11 +1008,11 @@ discard block |
||
| 1008 | 1008 | */ |
| 1009 | 1009 | function ps_restore($psdoc): void |
| 1010 | 1010 | { |
| 1011 | - error_clear_last(); |
|
| 1012 | - $result = \ps_restore($psdoc); |
|
| 1013 | - if ($result === false) { |
|
| 1014 | - throw PsException::createFromPhpError(); |
|
| 1015 | - } |
|
| 1011 | + error_clear_last(); |
|
| 1012 | + $result = \ps_restore($psdoc); |
|
| 1013 | + if ($result === false) { |
|
| 1014 | + throw PsException::createFromPhpError(); |
|
| 1015 | + } |
|
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | |
@@ -1027,11 +1027,11 @@ discard block |
||
| 1027 | 1027 | */ |
| 1028 | 1028 | function ps_rotate($psdoc, float $rot): void |
| 1029 | 1029 | { |
| 1030 | - error_clear_last(); |
|
| 1031 | - $result = \ps_rotate($psdoc, $rot); |
|
| 1032 | - if ($result === false) { |
|
| 1033 | - throw PsException::createFromPhpError(); |
|
| 1034 | - } |
|
| 1030 | + error_clear_last(); |
|
| 1031 | + $result = \ps_rotate($psdoc, $rot); |
|
| 1032 | + if ($result === false) { |
|
| 1033 | + throw PsException::createFromPhpError(); |
|
| 1034 | + } |
|
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | |
@@ -1047,11 +1047,11 @@ discard block |
||
| 1047 | 1047 | */ |
| 1048 | 1048 | function ps_save($psdoc): void |
| 1049 | 1049 | { |
| 1050 | - error_clear_last(); |
|
| 1051 | - $result = \ps_save($psdoc); |
|
| 1052 | - if ($result === false) { |
|
| 1053 | - throw PsException::createFromPhpError(); |
|
| 1054 | - } |
|
| 1050 | + error_clear_last(); |
|
| 1051 | + $result = \ps_save($psdoc); |
|
| 1052 | + if ($result === false) { |
|
| 1053 | + throw PsException::createFromPhpError(); |
|
| 1054 | + } |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | |
@@ -1067,11 +1067,11 @@ discard block |
||
| 1067 | 1067 | */ |
| 1068 | 1068 | function ps_scale($psdoc, float $x, float $y): void |
| 1069 | 1069 | { |
| 1070 | - error_clear_last(); |
|
| 1071 | - $result = \ps_scale($psdoc, $x, $y); |
|
| 1072 | - if ($result === false) { |
|
| 1073 | - throw PsException::createFromPhpError(); |
|
| 1074 | - } |
|
| 1070 | + error_clear_last(); |
|
| 1071 | + $result = \ps_scale($psdoc, $x, $y); |
|
| 1072 | + if ($result === false) { |
|
| 1073 | + throw PsException::createFromPhpError(); |
|
| 1074 | + } |
|
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 | |
@@ -1093,11 +1093,11 @@ discard block |
||
| 1093 | 1093 | */ |
| 1094 | 1094 | function ps_set_border_color($psdoc, float $red, float $green, float $blue): void |
| 1095 | 1095 | { |
| 1096 | - error_clear_last(); |
|
| 1097 | - $result = \ps_set_border_color($psdoc, $red, $green, $blue); |
|
| 1098 | - if ($result === false) { |
|
| 1099 | - throw PsException::createFromPhpError(); |
|
| 1100 | - } |
|
| 1096 | + error_clear_last(); |
|
| 1097 | + $result = \ps_set_border_color($psdoc, $red, $green, $blue); |
|
| 1098 | + if ($result === false) { |
|
| 1099 | + throw PsException::createFromPhpError(); |
|
| 1100 | + } |
|
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | |
@@ -1119,11 +1119,11 @@ discard block |
||
| 1119 | 1119 | */ |
| 1120 | 1120 | function ps_set_border_dash($psdoc, float $black, float $white): void |
| 1121 | 1121 | { |
| 1122 | - error_clear_last(); |
|
| 1123 | - $result = \ps_set_border_dash($psdoc, $black, $white); |
|
| 1124 | - if ($result === false) { |
|
| 1125 | - throw PsException::createFromPhpError(); |
|
| 1126 | - } |
|
| 1122 | + error_clear_last(); |
|
| 1123 | + $result = \ps_set_border_dash($psdoc, $black, $white); |
|
| 1124 | + if ($result === false) { |
|
| 1125 | + throw PsException::createFromPhpError(); |
|
| 1126 | + } |
|
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | |
@@ -1145,11 +1145,11 @@ discard block |
||
| 1145 | 1145 | */ |
| 1146 | 1146 | function ps_set_border_style($psdoc, string $style, float $width): void |
| 1147 | 1147 | { |
| 1148 | - error_clear_last(); |
|
| 1149 | - $result = \ps_set_border_style($psdoc, $style, $width); |
|
| 1150 | - if ($result === false) { |
|
| 1151 | - throw PsException::createFromPhpError(); |
|
| 1152 | - } |
|
| 1148 | + error_clear_last(); |
|
| 1149 | + $result = \ps_set_border_style($psdoc, $style, $width); |
|
| 1150 | + if ($result === false) { |
|
| 1151 | + throw PsException::createFromPhpError(); |
|
| 1152 | + } |
|
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | |
@@ -1192,11 +1192,11 @@ discard block |
||
| 1192 | 1192 | */ |
| 1193 | 1193 | function ps_set_info($p, string $key, string $val): void |
| 1194 | 1194 | { |
| 1195 | - error_clear_last(); |
|
| 1196 | - $result = \ps_set_info($p, $key, $val); |
|
| 1197 | - if ($result === false) { |
|
| 1198 | - throw PsException::createFromPhpError(); |
|
| 1199 | - } |
|
| 1195 | + error_clear_last(); |
|
| 1196 | + $result = \ps_set_info($p, $key, $val); |
|
| 1197 | + if ($result === false) { |
|
| 1198 | + throw PsException::createFromPhpError(); |
|
| 1199 | + } |
|
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | |
@@ -1213,11 +1213,11 @@ discard block |
||
| 1213 | 1213 | */ |
| 1214 | 1214 | function ps_set_parameter($psdoc, string $name, string $value): void |
| 1215 | 1215 | { |
| 1216 | - error_clear_last(); |
|
| 1217 | - $result = \ps_set_parameter($psdoc, $name, $value); |
|
| 1218 | - if ($result === false) { |
|
| 1219 | - throw PsException::createFromPhpError(); |
|
| 1220 | - } |
|
| 1216 | + error_clear_last(); |
|
| 1217 | + $result = \ps_set_parameter($psdoc, $name, $value); |
|
| 1218 | + if ($result === false) { |
|
| 1219 | + throw PsException::createFromPhpError(); |
|
| 1220 | + } |
|
| 1221 | 1221 | } |
| 1222 | 1222 | |
| 1223 | 1223 | |
@@ -1240,11 +1240,11 @@ discard block |
||
| 1240 | 1240 | */ |
| 1241 | 1241 | function ps_set_text_pos($psdoc, float $x, float $y): void |
| 1242 | 1242 | { |
| 1243 | - error_clear_last(); |
|
| 1244 | - $result = \ps_set_text_pos($psdoc, $x, $y); |
|
| 1245 | - if ($result === false) { |
|
| 1246 | - throw PsException::createFromPhpError(); |
|
| 1247 | - } |
|
| 1243 | + error_clear_last(); |
|
| 1244 | + $result = \ps_set_text_pos($psdoc, $x, $y); |
|
| 1245 | + if ($result === false) { |
|
| 1246 | + throw PsException::createFromPhpError(); |
|
| 1247 | + } |
|
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | |
@@ -1313,11 +1313,11 @@ discard block |
||
| 1313 | 1313 | */ |
| 1314 | 1314 | function ps_set_value($psdoc, string $name, float $value): void |
| 1315 | 1315 | { |
| 1316 | - error_clear_last(); |
|
| 1317 | - $result = \ps_set_value($psdoc, $name, $value); |
|
| 1318 | - if ($result === false) { |
|
| 1319 | - throw PsException::createFromPhpError(); |
|
| 1320 | - } |
|
| 1316 | + error_clear_last(); |
|
| 1317 | + $result = \ps_set_value($psdoc, $name, $value); |
|
| 1318 | + if ($result === false) { |
|
| 1319 | + throw PsException::createFromPhpError(); |
|
| 1320 | + } |
|
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | |
@@ -1348,11 +1348,11 @@ discard block |
||
| 1348 | 1348 | */ |
| 1349 | 1349 | function ps_setcolor($psdoc, string $type, string $colorspace, float $c1, float $c2, float $c3, float $c4): void |
| 1350 | 1350 | { |
| 1351 | - error_clear_last(); |
|
| 1352 | - $result = \ps_setcolor($psdoc, $type, $colorspace, $c1, $c2, $c3, $c4); |
|
| 1353 | - if ($result === false) { |
|
| 1354 | - throw PsException::createFromPhpError(); |
|
| 1355 | - } |
|
| 1351 | + error_clear_last(); |
|
| 1352 | + $result = \ps_setcolor($psdoc, $type, $colorspace, $c1, $c2, $c3, $c4); |
|
| 1353 | + if ($result === false) { |
|
| 1354 | + throw PsException::createFromPhpError(); |
|
| 1355 | + } |
|
| 1356 | 1356 | } |
| 1357 | 1357 | |
| 1358 | 1358 | |
@@ -1368,11 +1368,11 @@ discard block |
||
| 1368 | 1368 | */ |
| 1369 | 1369 | function ps_setdash($psdoc, float $on, float $off): void |
| 1370 | 1370 | { |
| 1371 | - error_clear_last(); |
|
| 1372 | - $result = \ps_setdash($psdoc, $on, $off); |
|
| 1373 | - if ($result === false) { |
|
| 1374 | - throw PsException::createFromPhpError(); |
|
| 1375 | - } |
|
| 1371 | + error_clear_last(); |
|
| 1372 | + $result = \ps_setdash($psdoc, $on, $off); |
|
| 1373 | + if ($result === false) { |
|
| 1374 | + throw PsException::createFromPhpError(); |
|
| 1375 | + } |
|
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | |
@@ -1389,11 +1389,11 @@ discard block |
||
| 1389 | 1389 | */ |
| 1390 | 1390 | function ps_setflat($psdoc, float $value): void |
| 1391 | 1391 | { |
| 1392 | - error_clear_last(); |
|
| 1393 | - $result = \ps_setflat($psdoc, $value); |
|
| 1394 | - if ($result === false) { |
|
| 1395 | - throw PsException::createFromPhpError(); |
|
| 1396 | - } |
|
| 1392 | + error_clear_last(); |
|
| 1393 | + $result = \ps_setflat($psdoc, $value); |
|
| 1394 | + if ($result === false) { |
|
| 1395 | + throw PsException::createFromPhpError(); |
|
| 1396 | + } |
|
| 1397 | 1397 | } |
| 1398 | 1398 | |
| 1399 | 1399 | |
@@ -1411,11 +1411,11 @@ discard block |
||
| 1411 | 1411 | */ |
| 1412 | 1412 | function ps_setfont($psdoc, int $fontid, float $size): void |
| 1413 | 1413 | { |
| 1414 | - error_clear_last(); |
|
| 1415 | - $result = \ps_setfont($psdoc, $fontid, $size); |
|
| 1416 | - if ($result === false) { |
|
| 1417 | - throw PsException::createFromPhpError(); |
|
| 1418 | - } |
|
| 1414 | + error_clear_last(); |
|
| 1415 | + $result = \ps_setfont($psdoc, $fontid, $size); |
|
| 1416 | + if ($result === false) { |
|
| 1417 | + throw PsException::createFromPhpError(); |
|
| 1418 | + } |
|
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | |
@@ -1430,11 +1430,11 @@ discard block |
||
| 1430 | 1430 | */ |
| 1431 | 1431 | function ps_setgray($psdoc, float $gray): void |
| 1432 | 1432 | { |
| 1433 | - error_clear_last(); |
|
| 1434 | - $result = \ps_setgray($psdoc, $gray); |
|
| 1435 | - if ($result === false) { |
|
| 1436 | - throw PsException::createFromPhpError(); |
|
| 1437 | - } |
|
| 1433 | + error_clear_last(); |
|
| 1434 | + $result = \ps_setgray($psdoc, $gray); |
|
| 1435 | + if ($result === false) { |
|
| 1436 | + throw PsException::createFromPhpError(); |
|
| 1437 | + } |
|
| 1438 | 1438 | } |
| 1439 | 1439 | |
| 1440 | 1440 | |
@@ -1452,11 +1452,11 @@ discard block |
||
| 1452 | 1452 | */ |
| 1453 | 1453 | function ps_setlinecap($psdoc, int $type): void |
| 1454 | 1454 | { |
| 1455 | - error_clear_last(); |
|
| 1456 | - $result = \ps_setlinecap($psdoc, $type); |
|
| 1457 | - if ($result === false) { |
|
| 1458 | - throw PsException::createFromPhpError(); |
|
| 1459 | - } |
|
| 1455 | + error_clear_last(); |
|
| 1456 | + $result = \ps_setlinecap($psdoc, $type); |
|
| 1457 | + if ($result === false) { |
|
| 1458 | + throw PsException::createFromPhpError(); |
|
| 1459 | + } |
|
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | |
@@ -1474,11 +1474,11 @@ discard block |
||
| 1474 | 1474 | */ |
| 1475 | 1475 | function ps_setlinejoin($psdoc, int $type): void |
| 1476 | 1476 | { |
| 1477 | - error_clear_last(); |
|
| 1478 | - $result = \ps_setlinejoin($psdoc, $type); |
|
| 1479 | - if ($result === false) { |
|
| 1480 | - throw PsException::createFromPhpError(); |
|
| 1481 | - } |
|
| 1477 | + error_clear_last(); |
|
| 1478 | + $result = \ps_setlinejoin($psdoc, $type); |
|
| 1479 | + if ($result === false) { |
|
| 1480 | + throw PsException::createFromPhpError(); |
|
| 1481 | + } |
|
| 1482 | 1482 | } |
| 1483 | 1483 | |
| 1484 | 1484 | |
@@ -1493,11 +1493,11 @@ discard block |
||
| 1493 | 1493 | */ |
| 1494 | 1494 | function ps_setlinewidth($psdoc, float $width): void |
| 1495 | 1495 | { |
| 1496 | - error_clear_last(); |
|
| 1497 | - $result = \ps_setlinewidth($psdoc, $width); |
|
| 1498 | - if ($result === false) { |
|
| 1499 | - throw PsException::createFromPhpError(); |
|
| 1500 | - } |
|
| 1496 | + error_clear_last(); |
|
| 1497 | + $result = \ps_setlinewidth($psdoc, $width); |
|
| 1498 | + if ($result === false) { |
|
| 1499 | + throw PsException::createFromPhpError(); |
|
| 1500 | + } |
|
| 1501 | 1501 | } |
| 1502 | 1502 | |
| 1503 | 1503 | |
@@ -1517,11 +1517,11 @@ discard block |
||
| 1517 | 1517 | */ |
| 1518 | 1518 | function ps_setmiterlimit($psdoc, float $value): void |
| 1519 | 1519 | { |
| 1520 | - error_clear_last(); |
|
| 1521 | - $result = \ps_setmiterlimit($psdoc, $value); |
|
| 1522 | - if ($result === false) { |
|
| 1523 | - throw PsException::createFromPhpError(); |
|
| 1524 | - } |
|
| 1520 | + error_clear_last(); |
|
| 1521 | + $result = \ps_setmiterlimit($psdoc, $value); |
|
| 1522 | + if ($result === false) { |
|
| 1523 | + throw PsException::createFromPhpError(); |
|
| 1524 | + } |
|
| 1525 | 1525 | } |
| 1526 | 1526 | |
| 1527 | 1527 | |
@@ -1538,11 +1538,11 @@ discard block |
||
| 1538 | 1538 | */ |
| 1539 | 1539 | function ps_setoverprintmode($psdoc, int $mode): void |
| 1540 | 1540 | { |
| 1541 | - error_clear_last(); |
|
| 1542 | - $result = \ps_setoverprintmode($psdoc, $mode); |
|
| 1543 | - if ($result === false) { |
|
| 1544 | - throw PsException::createFromPhpError(); |
|
| 1545 | - } |
|
| 1541 | + error_clear_last(); |
|
| 1542 | + $result = \ps_setoverprintmode($psdoc, $mode); |
|
| 1543 | + if ($result === false) { |
|
| 1544 | + throw PsException::createFromPhpError(); |
|
| 1545 | + } |
|
| 1546 | 1546 | } |
| 1547 | 1547 | |
| 1548 | 1548 | |
@@ -1560,11 +1560,11 @@ discard block |
||
| 1560 | 1560 | */ |
| 1561 | 1561 | function ps_setpolydash($psdoc, float $arr): void |
| 1562 | 1562 | { |
| 1563 | - error_clear_last(); |
|
| 1564 | - $result = \ps_setpolydash($psdoc, $arr); |
|
| 1565 | - if ($result === false) { |
|
| 1566 | - throw PsException::createFromPhpError(); |
|
| 1567 | - } |
|
| 1563 | + error_clear_last(); |
|
| 1564 | + $result = \ps_setpolydash($psdoc, $arr); |
|
| 1565 | + if ($result === false) { |
|
| 1566 | + throw PsException::createFromPhpError(); |
|
| 1567 | + } |
|
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | 1570 | |
@@ -1584,12 +1584,12 @@ discard block |
||
| 1584 | 1584 | */ |
| 1585 | 1585 | function ps_shading_pattern($psdoc, int $shadingid, string $optlist): int |
| 1586 | 1586 | { |
| 1587 | - error_clear_last(); |
|
| 1588 | - $result = \ps_shading_pattern($psdoc, $shadingid, $optlist); |
|
| 1589 | - if ($result === false) { |
|
| 1590 | - throw PsException::createFromPhpError(); |
|
| 1591 | - } |
|
| 1592 | - return $result; |
|
| 1587 | + error_clear_last(); |
|
| 1588 | + $result = \ps_shading_pattern($psdoc, $shadingid, $optlist); |
|
| 1589 | + if ($result === false) { |
|
| 1590 | + throw PsException::createFromPhpError(); |
|
| 1591 | + } |
|
| 1592 | + return $result; |
|
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | 1595 | |
@@ -1629,12 +1629,12 @@ discard block |
||
| 1629 | 1629 | */ |
| 1630 | 1630 | function ps_shading($psdoc, string $type, float $x0, float $y0, float $x1, float $y1, float $c1, float $c2, float $c3, float $c4, string $optlist): int |
| 1631 | 1631 | { |
| 1632 | - error_clear_last(); |
|
| 1633 | - $result = \ps_shading($psdoc, $type, $x0, $y0, $x1, $y1, $c1, $c2, $c3, $c4, $optlist); |
|
| 1634 | - if ($result === false) { |
|
| 1635 | - throw PsException::createFromPhpError(); |
|
| 1636 | - } |
|
| 1637 | - return $result; |
|
| 1632 | + error_clear_last(); |
|
| 1633 | + $result = \ps_shading($psdoc, $type, $x0, $y0, $x1, $y1, $c1, $c2, $c3, $c4, $optlist); |
|
| 1634 | + if ($result === false) { |
|
| 1635 | + throw PsException::createFromPhpError(); |
|
| 1636 | + } |
|
| 1637 | + return $result; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | |
@@ -1653,11 +1653,11 @@ discard block |
||
| 1653 | 1653 | */ |
| 1654 | 1654 | function ps_shfill($psdoc, int $shadingid): void |
| 1655 | 1655 | { |
| 1656 | - error_clear_last(); |
|
| 1657 | - $result = \ps_shfill($psdoc, $shadingid); |
|
| 1658 | - if ($result === false) { |
|
| 1659 | - throw PsException::createFromPhpError(); |
|
| 1660 | - } |
|
| 1656 | + error_clear_last(); |
|
| 1657 | + $result = \ps_shfill($psdoc, $shadingid); |
|
| 1658 | + if ($result === false) { |
|
| 1659 | + throw PsException::createFromPhpError(); |
|
| 1660 | + } |
|
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | |
@@ -1674,11 +1674,11 @@ discard block |
||
| 1674 | 1674 | */ |
| 1675 | 1675 | function ps_show_xy($psdoc, string $text, float $x, float $y): void |
| 1676 | 1676 | { |
| 1677 | - error_clear_last(); |
|
| 1678 | - $result = \ps_show_xy($psdoc, $text, $x, $y); |
|
| 1679 | - if ($result === false) { |
|
| 1680 | - throw PsException::createFromPhpError(); |
|
| 1681 | - } |
|
| 1677 | + error_clear_last(); |
|
| 1678 | + $result = \ps_show_xy($psdoc, $text, $x, $y); |
|
| 1679 | + if ($result === false) { |
|
| 1680 | + throw PsException::createFromPhpError(); |
|
| 1681 | + } |
|
| 1682 | 1682 | } |
| 1683 | 1683 | |
| 1684 | 1684 | |
@@ -1697,11 +1697,11 @@ discard block |
||
| 1697 | 1697 | */ |
| 1698 | 1698 | function ps_show_xy2($psdoc, string $text, int $len, float $xcoor, float $ycoor): void |
| 1699 | 1699 | { |
| 1700 | - error_clear_last(); |
|
| 1701 | - $result = \ps_show_xy2($psdoc, $text, $len, $xcoor, $ycoor); |
|
| 1702 | - if ($result === false) { |
|
| 1703 | - throw PsException::createFromPhpError(); |
|
| 1704 | - } |
|
| 1700 | + error_clear_last(); |
|
| 1701 | + $result = \ps_show_xy2($psdoc, $text, $len, $xcoor, $ycoor); |
|
| 1702 | + if ($result === false) { |
|
| 1703 | + throw PsException::createFromPhpError(); |
|
| 1704 | + } |
|
| 1705 | 1705 | } |
| 1706 | 1706 | |
| 1707 | 1707 | |
@@ -1724,11 +1724,11 @@ discard block |
||
| 1724 | 1724 | */ |
| 1725 | 1725 | function ps_show($psdoc, string $text): void |
| 1726 | 1726 | { |
| 1727 | - error_clear_last(); |
|
| 1728 | - $result = \ps_show($psdoc, $text); |
|
| 1729 | - if ($result === false) { |
|
| 1730 | - throw PsException::createFromPhpError(); |
|
| 1731 | - } |
|
| 1727 | + error_clear_last(); |
|
| 1728 | + $result = \ps_show($psdoc, $text); |
|
| 1729 | + if ($result === false) { |
|
| 1730 | + throw PsException::createFromPhpError(); |
|
| 1731 | + } |
|
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | 1734 | |
@@ -1744,11 +1744,11 @@ discard block |
||
| 1744 | 1744 | */ |
| 1745 | 1745 | function ps_show2($psdoc, string $text, int $len): void |
| 1746 | 1746 | { |
| 1747 | - error_clear_last(); |
|
| 1748 | - $result = \ps_show2($psdoc, $text, $len); |
|
| 1749 | - if ($result === false) { |
|
| 1750 | - throw PsException::createFromPhpError(); |
|
| 1751 | - } |
|
| 1747 | + error_clear_last(); |
|
| 1748 | + $result = \ps_show2($psdoc, $text, $len); |
|
| 1749 | + if ($result === false) { |
|
| 1750 | + throw PsException::createFromPhpError(); |
|
| 1751 | + } |
|
| 1752 | 1752 | } |
| 1753 | 1753 | |
| 1754 | 1754 | |
@@ -1763,11 +1763,11 @@ discard block |
||
| 1763 | 1763 | */ |
| 1764 | 1764 | function ps_stroke($psdoc): void |
| 1765 | 1765 | { |
| 1766 | - error_clear_last(); |
|
| 1767 | - $result = \ps_stroke($psdoc); |
|
| 1768 | - if ($result === false) { |
|
| 1769 | - throw PsException::createFromPhpError(); |
|
| 1770 | - } |
|
| 1766 | + error_clear_last(); |
|
| 1767 | + $result = \ps_stroke($psdoc); |
|
| 1768 | + if ($result === false) { |
|
| 1769 | + throw PsException::createFromPhpError(); |
|
| 1770 | + } |
|
| 1771 | 1771 | } |
| 1772 | 1772 | |
| 1773 | 1773 | |
@@ -1784,11 +1784,11 @@ discard block |
||
| 1784 | 1784 | */ |
| 1785 | 1785 | function ps_symbol($psdoc, int $ord): void |
| 1786 | 1786 | { |
| 1787 | - error_clear_last(); |
|
| 1788 | - $result = \ps_symbol($psdoc, $ord); |
|
| 1789 | - if ($result === false) { |
|
| 1790 | - throw PsException::createFromPhpError(); |
|
| 1791 | - } |
|
| 1787 | + error_clear_last(); |
|
| 1788 | + $result = \ps_symbol($psdoc, $ord); |
|
| 1789 | + if ($result === false) { |
|
| 1790 | + throw PsException::createFromPhpError(); |
|
| 1791 | + } |
|
| 1792 | 1792 | } |
| 1793 | 1793 | |
| 1794 | 1794 | |
@@ -1804,9 +1804,9 @@ discard block |
||
| 1804 | 1804 | */ |
| 1805 | 1805 | function ps_translate($psdoc, float $x, float $y): void |
| 1806 | 1806 | { |
| 1807 | - error_clear_last(); |
|
| 1808 | - $result = \ps_translate($psdoc, $x, $y); |
|
| 1809 | - if ($result === false) { |
|
| 1810 | - throw PsException::createFromPhpError(); |
|
| 1811 | - } |
|
| 1807 | + error_clear_last(); |
|
| 1808 | + $result = \ps_translate($psdoc, $x, $y); |
|
| 1809 | + if ($result === false) { |
|
| 1810 | + throw PsException::createFromPhpError(); |
|
| 1811 | + } |
|
| 1812 | 1812 | } |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | function opcache_compile_file(string $file): void |
| 17 | 17 | { |
| 18 | - error_clear_last(); |
|
| 19 | - $result = \opcache_compile_file($file); |
|
| 20 | - if ($result === false) { |
|
| 21 | - throw OpcacheException::createFromPhpError(); |
|
| 22 | - } |
|
| 18 | + error_clear_last(); |
|
| 19 | + $result = \opcache_compile_file($file); |
|
| 20 | + if ($result === false) { |
|
| 21 | + throw OpcacheException::createFromPhpError(); |
|
| 22 | + } |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function opcache_get_status(bool $get_scripts = true): array |
| 35 | 35 | { |
| 36 | - error_clear_last(); |
|
| 37 | - $result = \opcache_get_status($get_scripts); |
|
| 38 | - if ($result === false) { |
|
| 39 | - throw OpcacheException::createFromPhpError(); |
|
| 40 | - } |
|
| 41 | - return $result; |
|
| 36 | + error_clear_last(); |
|
| 37 | + $result = \opcache_get_status($get_scripts); |
|
| 38 | + if ($result === false) { |
|
| 39 | + throw OpcacheException::createFromPhpError(); |
|
| 40 | + } |
|
| 41 | + return $result; |
|
| 42 | 42 | } |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | function chdir(string $directory): void |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \chdir($directory); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw DirException::createFromPhpError(); |
|
| 21 | - } |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \chdir($directory); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw DirException::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | function chroot(string $directory): void |
| 39 | 39 | { |
| 40 | - error_clear_last(); |
|
| 41 | - $result = \chroot($directory); |
|
| 42 | - if ($result === false) { |
|
| 43 | - throw DirException::createFromPhpError(); |
|
| 44 | - } |
|
| 40 | + error_clear_last(); |
|
| 41 | + $result = \chroot($directory); |
|
| 42 | + if ($result === false) { |
|
| 43 | + throw DirException::createFromPhpError(); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function getcwd(): string |
| 62 | 62 | { |
| 63 | - error_clear_last(); |
|
| 64 | - $result = \getcwd(); |
|
| 65 | - if ($result === false) { |
|
| 66 | - throw DirException::createFromPhpError(); |
|
| 67 | - } |
|
| 68 | - return $result; |
|
| 63 | + error_clear_last(); |
|
| 64 | + $result = \getcwd(); |
|
| 65 | + if ($result === false) { |
|
| 66 | + throw DirException::createFromPhpError(); |
|
| 67 | + } |
|
| 68 | + return $result; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -84,16 +84,16 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | function opendir(string $path, $context = null) |
| 86 | 86 | { |
| 87 | - error_clear_last(); |
|
| 88 | - if ($context !== null) { |
|
| 89 | - $result = \opendir($path, $context); |
|
| 90 | - } else { |
|
| 91 | - $result = \opendir($path); |
|
| 92 | - } |
|
| 93 | - if ($result === false) { |
|
| 94 | - throw DirException::createFromPhpError(); |
|
| 95 | - } |
|
| 96 | - return $result; |
|
| 87 | + error_clear_last(); |
|
| 88 | + if ($context !== null) { |
|
| 89 | + $result = \opendir($path, $context); |
|
| 90 | + } else { |
|
| 91 | + $result = \opendir($path); |
|
| 92 | + } |
|
| 93 | + if ($result === false) { |
|
| 94 | + throw DirException::createFromPhpError(); |
|
| 95 | + } |
|
| 96 | + return $result; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
@@ -111,15 +111,15 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | function rewinddir($dir_handle = null): void |
| 113 | 113 | { |
| 114 | - error_clear_last(); |
|
| 115 | - if ($dir_handle !== null) { |
|
| 116 | - $result = \rewinddir($dir_handle); |
|
| 117 | - } else { |
|
| 118 | - $result = \rewinddir(); |
|
| 119 | - } |
|
| 120 | - if ($result === false) { |
|
| 121 | - throw DirException::createFromPhpError(); |
|
| 122 | - } |
|
| 114 | + error_clear_last(); |
|
| 115 | + if ($dir_handle !== null) { |
|
| 116 | + $result = \rewinddir($dir_handle); |
|
| 117 | + } else { |
|
| 118 | + $result = \rewinddir(); |
|
| 119 | + } |
|
| 120 | + if ($result === false) { |
|
| 121 | + throw DirException::createFromPhpError(); |
|
| 122 | + } |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -144,14 +144,14 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array |
| 146 | 146 | { |
| 147 | - error_clear_last(); |
|
| 148 | - if ($context !== null) { |
|
| 149 | - $result = \scandir($directory, $sorting_order, $context); |
|
| 150 | - } else { |
|
| 151 | - $result = \scandir($directory, $sorting_order); |
|
| 152 | - } |
|
| 153 | - if ($result === false) { |
|
| 154 | - throw DirException::createFromPhpError(); |
|
| 155 | - } |
|
| 156 | - return $result; |
|
| 147 | + error_clear_last(); |
|
| 148 | + if ($context !== null) { |
|
| 149 | + $result = \scandir($directory, $sorting_order, $context); |
|
| 150 | + } else { |
|
| 151 | + $result = \scandir($directory, $sorting_order); |
|
| 152 | + } |
|
| 153 | + if ($result === false) { |
|
| 154 | + throw DirException::createFromPhpError(); |
|
| 155 | + } |
|
| 156 | + return $result; |
|
| 157 | 157 | } |
@@ -14,9 +14,9 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | function fastcgi_finish_request(): void |
| 16 | 16 | { |
| 17 | - error_clear_last(); |
|
| 18 | - $result = \fastcgi_finish_request(); |
|
| 19 | - if ($result === false) { |
|
| 20 | - throw FpmException::createFromPhpError(); |
|
| 21 | - } |
|
| 17 | + error_clear_last(); |
|
| 18 | + $result = \fastcgi_finish_request(); |
|
| 19 | + if ($result === false) { |
|
| 20 | + throw FpmException::createFromPhpError(); |
|
| 21 | + } |
|
| 22 | 22 | } |
@@ -52,9 +52,9 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | function settype(&$var, string $type): void |
| 54 | 54 | { |
| 55 | - error_clear_last(); |
|
| 56 | - $result = \settype($var, $type); |
|
| 57 | - if ($result === false) { |
|
| 58 | - throw VarException::createFromPhpError(); |
|
| 59 | - } |
|
| 55 | + error_clear_last(); |
|
| 56 | + $result = \settype($var, $type); |
|
| 57 | + if ($result === false) { |
|
| 58 | + throw VarException::createFromPhpError(); |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function chgrp(string $filename, $group): void |
| 20 | 20 | { |
| 21 | - error_clear_last(); |
|
| 22 | - $result = \chgrp($filename, $group); |
|
| 23 | - if ($result === false) { |
|
| 24 | - throw FilesystemException::createFromPhpError(); |
|
| 25 | - } |
|
| 21 | + error_clear_last(); |
|
| 22 | + $result = \chgrp($filename, $group); |
|
| 23 | + if ($result === false) { |
|
| 24 | + throw FilesystemException::createFromPhpError(); |
|
| 25 | + } |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | function chmod(string $filename, int $mode): void |
| 62 | 62 | { |
| 63 | - error_clear_last(); |
|
| 64 | - $result = \chmod($filename, $mode); |
|
| 65 | - if ($result === false) { |
|
| 66 | - throw FilesystemException::createFromPhpError(); |
|
| 67 | - } |
|
| 63 | + error_clear_last(); |
|
| 64 | + $result = \chmod($filename, $mode); |
|
| 65 | + if ($result === false) { |
|
| 66 | + throw FilesystemException::createFromPhpError(); |
|
| 67 | + } |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | function chown(string $filename, $user): void |
| 82 | 82 | { |
| 83 | - error_clear_last(); |
|
| 84 | - $result = \chown($filename, $user); |
|
| 85 | - if ($result === false) { |
|
| 86 | - throw FilesystemException::createFromPhpError(); |
|
| 87 | - } |
|
| 83 | + error_clear_last(); |
|
| 84 | + $result = \chown($filename, $user); |
|
| 85 | + if ($result === false) { |
|
| 86 | + throw FilesystemException::createFromPhpError(); |
|
| 87 | + } |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -107,15 +107,15 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | function copy(string $source, string $dest, $context = null): void |
| 109 | 109 | { |
| 110 | - error_clear_last(); |
|
| 111 | - if ($context !== null) { |
|
| 112 | - $result = \copy($source, $dest, $context); |
|
| 113 | - } else { |
|
| 114 | - $result = \copy($source, $dest); |
|
| 115 | - } |
|
| 116 | - if ($result === false) { |
|
| 117 | - throw FilesystemException::createFromPhpError(); |
|
| 118 | - } |
|
| 110 | + error_clear_last(); |
|
| 111 | + if ($context !== null) { |
|
| 112 | + $result = \copy($source, $dest, $context); |
|
| 113 | + } else { |
|
| 114 | + $result = \copy($source, $dest); |
|
| 115 | + } |
|
| 116 | + if ($result === false) { |
|
| 117 | + throw FilesystemException::createFromPhpError(); |
|
| 118 | + } |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | function disk_free_space(string $directory): float |
| 137 | 137 | { |
| 138 | - error_clear_last(); |
|
| 139 | - $result = \disk_free_space($directory); |
|
| 140 | - if ($result === false) { |
|
| 141 | - throw FilesystemException::createFromPhpError(); |
|
| 142 | - } |
|
| 143 | - return $result; |
|
| 138 | + error_clear_last(); |
|
| 139 | + $result = \disk_free_space($directory); |
|
| 140 | + if ($result === false) { |
|
| 141 | + throw FilesystemException::createFromPhpError(); |
|
| 142 | + } |
|
| 143 | + return $result; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | function disk_total_space(string $directory): float |
| 157 | 157 | { |
| 158 | - error_clear_last(); |
|
| 159 | - $result = \disk_total_space($directory); |
|
| 160 | - if ($result === false) { |
|
| 161 | - throw FilesystemException::createFromPhpError(); |
|
| 162 | - } |
|
| 163 | - return $result; |
|
| 158 | + error_clear_last(); |
|
| 159 | + $result = \disk_total_space($directory); |
|
| 160 | + if ($result === false) { |
|
| 161 | + throw FilesystemException::createFromPhpError(); |
|
| 162 | + } |
|
| 163 | + return $result; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | function fclose($handle): void |
| 176 | 176 | { |
| 177 | - error_clear_last(); |
|
| 178 | - $result = \fclose($handle); |
|
| 179 | - if ($result === false) { |
|
| 180 | - throw FilesystemException::createFromPhpError(); |
|
| 181 | - } |
|
| 177 | + error_clear_last(); |
|
| 178 | + $result = \fclose($handle); |
|
| 179 | + if ($result === false) { |
|
| 180 | + throw FilesystemException::createFromPhpError(); |
|
| 181 | + } |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | function fflush($handle): void |
| 197 | 197 | { |
| 198 | - error_clear_last(); |
|
| 199 | - $result = \fflush($handle); |
|
| 200 | - if ($result === false) { |
|
| 201 | - throw FilesystemException::createFromPhpError(); |
|
| 202 | - } |
|
| 198 | + error_clear_last(); |
|
| 199 | + $result = \fflush($handle); |
|
| 200 | + if ($result === false) { |
|
| 201 | + throw FilesystemException::createFromPhpError(); |
|
| 202 | + } |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
@@ -239,20 +239,20 @@ discard block |
||
| 239 | 239 | */ |
| 240 | 240 | function file_get_contents(string $filename, bool $use_include_path = false, $context = null, int $offset = 0, int $maxlen = null): string |
| 241 | 241 | { |
| 242 | - error_clear_last(); |
|
| 243 | - if ($maxlen !== null) { |
|
| 244 | - $result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen); |
|
| 245 | - } elseif ($offset !== 0) { |
|
| 246 | - $result = \file_get_contents($filename, $use_include_path, $context, $offset); |
|
| 247 | - } elseif ($context !== null) { |
|
| 248 | - $result = \file_get_contents($filename, $use_include_path, $context); |
|
| 249 | - } else { |
|
| 250 | - $result = \file_get_contents($filename, $use_include_path); |
|
| 251 | - } |
|
| 252 | - if ($result === false) { |
|
| 253 | - throw FilesystemException::createFromPhpError(); |
|
| 254 | - } |
|
| 255 | - return $result; |
|
| 242 | + error_clear_last(); |
|
| 243 | + if ($maxlen !== null) { |
|
| 244 | + $result = \file_get_contents($filename, $use_include_path, $context, $offset, $maxlen); |
|
| 245 | + } elseif ($offset !== 0) { |
|
| 246 | + $result = \file_get_contents($filename, $use_include_path, $context, $offset); |
|
| 247 | + } elseif ($context !== null) { |
|
| 248 | + $result = \file_get_contents($filename, $use_include_path, $context); |
|
| 249 | + } else { |
|
| 250 | + $result = \file_get_contents($filename, $use_include_path); |
|
| 251 | + } |
|
| 252 | + if ($result === false) { |
|
| 253 | + throw FilesystemException::createFromPhpError(); |
|
| 254 | + } |
|
| 255 | + return $result; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
@@ -332,16 +332,16 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | function file_put_contents(string $filename, $data, int $flags = 0, $context = null): int |
| 334 | 334 | { |
| 335 | - error_clear_last(); |
|
| 336 | - if ($context !== null) { |
|
| 337 | - $result = \file_put_contents($filename, $data, $flags, $context); |
|
| 338 | - } else { |
|
| 339 | - $result = \file_put_contents($filename, $data, $flags); |
|
| 340 | - } |
|
| 341 | - if ($result === false) { |
|
| 342 | - throw FilesystemException::createFromPhpError(); |
|
| 343 | - } |
|
| 344 | - return $result; |
|
| 335 | + error_clear_last(); |
|
| 336 | + if ($context !== null) { |
|
| 337 | + $result = \file_put_contents($filename, $data, $flags, $context); |
|
| 338 | + } else { |
|
| 339 | + $result = \file_put_contents($filename, $data, $flags); |
|
| 340 | + } |
|
| 341 | + if ($result === false) { |
|
| 342 | + throw FilesystemException::createFromPhpError(); |
|
| 343 | + } |
|
| 344 | + return $result; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | |
@@ -392,16 +392,16 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | function file(string $filename, int $flags = 0, $context = null): array |
| 394 | 394 | { |
| 395 | - error_clear_last(); |
|
| 396 | - if ($context !== null) { |
|
| 397 | - $result = \file($filename, $flags, $context); |
|
| 398 | - } else { |
|
| 399 | - $result = \file($filename, $flags); |
|
| 400 | - } |
|
| 401 | - if ($result === false) { |
|
| 402 | - throw FilesystemException::createFromPhpError(); |
|
| 403 | - } |
|
| 404 | - return $result; |
|
| 395 | + error_clear_last(); |
|
| 396 | + if ($context !== null) { |
|
| 397 | + $result = \file($filename, $flags, $context); |
|
| 398 | + } else { |
|
| 399 | + $result = \file($filename, $flags); |
|
| 400 | + } |
|
| 401 | + if ($result === false) { |
|
| 402 | + throw FilesystemException::createFromPhpError(); |
|
| 403 | + } |
|
| 404 | + return $result; |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | |
@@ -416,12 +416,12 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | function fileatime(string $filename): int |
| 418 | 418 | { |
| 419 | - error_clear_last(); |
|
| 420 | - $result = \fileatime($filename); |
|
| 421 | - if ($result === false) { |
|
| 422 | - throw FilesystemException::createFromPhpError(); |
|
| 423 | - } |
|
| 424 | - return $result; |
|
| 419 | + error_clear_last(); |
|
| 420 | + $result = \fileatime($filename); |
|
| 421 | + if ($result === false) { |
|
| 422 | + throw FilesystemException::createFromPhpError(); |
|
| 423 | + } |
|
| 424 | + return $result; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | |
@@ -436,12 +436,12 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | function filectime(string $filename): int |
| 438 | 438 | { |
| 439 | - error_clear_last(); |
|
| 440 | - $result = \filectime($filename); |
|
| 441 | - if ($result === false) { |
|
| 442 | - throw FilesystemException::createFromPhpError(); |
|
| 443 | - } |
|
| 444 | - return $result; |
|
| 439 | + error_clear_last(); |
|
| 440 | + $result = \filectime($filename); |
|
| 441 | + if ($result === false) { |
|
| 442 | + throw FilesystemException::createFromPhpError(); |
|
| 443 | + } |
|
| 444 | + return $result; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -455,12 +455,12 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | function fileinode(string $filename): int |
| 457 | 457 | { |
| 458 | - error_clear_last(); |
|
| 459 | - $result = \fileinode($filename); |
|
| 460 | - if ($result === false) { |
|
| 461 | - throw FilesystemException::createFromPhpError(); |
|
| 462 | - } |
|
| 463 | - return $result; |
|
| 458 | + error_clear_last(); |
|
| 459 | + $result = \fileinode($filename); |
|
| 460 | + if ($result === false) { |
|
| 461 | + throw FilesystemException::createFromPhpError(); |
|
| 462 | + } |
|
| 463 | + return $result; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | |
@@ -477,12 +477,12 @@ discard block |
||
| 477 | 477 | */ |
| 478 | 478 | function filemtime(string $filename): int |
| 479 | 479 | { |
| 480 | - error_clear_last(); |
|
| 481 | - $result = \filemtime($filename); |
|
| 482 | - if ($result === false) { |
|
| 483 | - throw FilesystemException::createFromPhpError(); |
|
| 484 | - } |
|
| 485 | - return $result; |
|
| 480 | + error_clear_last(); |
|
| 481 | + $result = \filemtime($filename); |
|
| 482 | + if ($result === false) { |
|
| 483 | + throw FilesystemException::createFromPhpError(); |
|
| 484 | + } |
|
| 485 | + return $result; |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | |
@@ -498,12 +498,12 @@ discard block |
||
| 498 | 498 | */ |
| 499 | 499 | function fileowner(string $filename): int |
| 500 | 500 | { |
| 501 | - error_clear_last(); |
|
| 502 | - $result = \fileowner($filename); |
|
| 503 | - if ($result === false) { |
|
| 504 | - throw FilesystemException::createFromPhpError(); |
|
| 505 | - } |
|
| 506 | - return $result; |
|
| 501 | + error_clear_last(); |
|
| 502 | + $result = \fileowner($filename); |
|
| 503 | + if ($result === false) { |
|
| 504 | + throw FilesystemException::createFromPhpError(); |
|
| 505 | + } |
|
| 506 | + return $result; |
|
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | |
@@ -518,12 +518,12 @@ discard block |
||
| 518 | 518 | */ |
| 519 | 519 | function filesize(string $filename): int |
| 520 | 520 | { |
| 521 | - error_clear_last(); |
|
| 522 | - $result = \filesize($filename); |
|
| 523 | - if ($result === false) { |
|
| 524 | - throw FilesystemException::createFromPhpError(); |
|
| 525 | - } |
|
| 526 | - return $result; |
|
| 521 | + error_clear_last(); |
|
| 522 | + $result = \filesize($filename); |
|
| 523 | + if ($result === false) { |
|
| 524 | + throw FilesystemException::createFromPhpError(); |
|
| 525 | + } |
|
| 526 | + return $result; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | |
@@ -572,11 +572,11 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | function flock($handle, int $operation, ?int &$wouldblock = null): void |
| 574 | 574 | { |
| 575 | - error_clear_last(); |
|
| 576 | - $result = \flock($handle, $operation, $wouldblock); |
|
| 577 | - if ($result === false) { |
|
| 578 | - throw FilesystemException::createFromPhpError(); |
|
| 579 | - } |
|
| 575 | + error_clear_last(); |
|
| 576 | + $result = \flock($handle, $operation, $wouldblock); |
|
| 577 | + if ($result === false) { |
|
| 578 | + throw FilesystemException::createFromPhpError(); |
|
| 579 | + } |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | |
@@ -781,16 +781,16 @@ discard block |
||
| 781 | 781 | */ |
| 782 | 782 | function fopen(string $filename, string $mode, bool $use_include_path = false, $context = null) |
| 783 | 783 | { |
| 784 | - error_clear_last(); |
|
| 785 | - if ($context !== null) { |
|
| 786 | - $result = \fopen($filename, $mode, $use_include_path, $context); |
|
| 787 | - } else { |
|
| 788 | - $result = \fopen($filename, $mode, $use_include_path); |
|
| 789 | - } |
|
| 790 | - if ($result === false) { |
|
| 791 | - throw FilesystemException::createFromPhpError(); |
|
| 792 | - } |
|
| 793 | - return $result; |
|
| 784 | + error_clear_last(); |
|
| 785 | + if ($context !== null) { |
|
| 786 | + $result = \fopen($filename, $mode, $use_include_path, $context); |
|
| 787 | + } else { |
|
| 788 | + $result = \fopen($filename, $mode, $use_include_path); |
|
| 789 | + } |
|
| 790 | + if ($result === false) { |
|
| 791 | + throw FilesystemException::createFromPhpError(); |
|
| 792 | + } |
|
| 793 | + return $result; |
|
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | |
@@ -817,12 +817,12 @@ discard block |
||
| 817 | 817 | */ |
| 818 | 818 | function fputcsv($handle, array $fields, string $delimiter = ",", string $enclosure = '"', string $escape_char = "\\"): int |
| 819 | 819 | { |
| 820 | - error_clear_last(); |
|
| 821 | - $result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char); |
|
| 822 | - if ($result === false) { |
|
| 823 | - throw FilesystemException::createFromPhpError(); |
|
| 824 | - } |
|
| 825 | - return $result; |
|
| 820 | + error_clear_last(); |
|
| 821 | + $result = \fputcsv($handle, $fields, $delimiter, $enclosure, $escape_char); |
|
| 822 | + if ($result === false) { |
|
| 823 | + throw FilesystemException::createFromPhpError(); |
|
| 824 | + } |
|
| 825 | + return $result; |
|
| 826 | 826 | } |
| 827 | 827 | |
| 828 | 828 | |
@@ -867,12 +867,12 @@ discard block |
||
| 867 | 867 | */ |
| 868 | 868 | function fread($handle, int $length): string |
| 869 | 869 | { |
| 870 | - error_clear_last(); |
|
| 871 | - $result = \fread($handle, $length); |
|
| 872 | - if ($result === false) { |
|
| 873 | - throw FilesystemException::createFromPhpError(); |
|
| 874 | - } |
|
| 875 | - return $result; |
|
| 870 | + error_clear_last(); |
|
| 871 | + $result = \fread($handle, $length); |
|
| 872 | + if ($result === false) { |
|
| 873 | + throw FilesystemException::createFromPhpError(); |
|
| 874 | + } |
|
| 875 | + return $result; |
|
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | |
@@ -895,11 +895,11 @@ discard block |
||
| 895 | 895 | */ |
| 896 | 896 | function ftruncate($handle, int $size): void |
| 897 | 897 | { |
| 898 | - error_clear_last(); |
|
| 899 | - $result = \ftruncate($handle, $size); |
|
| 900 | - if ($result === false) { |
|
| 901 | - throw FilesystemException::createFromPhpError(); |
|
| 902 | - } |
|
| 898 | + error_clear_last(); |
|
| 899 | + $result = \ftruncate($handle, $size); |
|
| 900 | + if ($result === false) { |
|
| 901 | + throw FilesystemException::createFromPhpError(); |
|
| 902 | + } |
|
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | |
@@ -924,16 +924,16 @@ discard block |
||
| 924 | 924 | */ |
| 925 | 925 | function fwrite($handle, string $string, int $length = null): int |
| 926 | 926 | { |
| 927 | - error_clear_last(); |
|
| 928 | - if ($length !== null) { |
|
| 929 | - $result = \fwrite($handle, $string, $length); |
|
| 930 | - } else { |
|
| 931 | - $result = \fwrite($handle, $string); |
|
| 932 | - } |
|
| 933 | - if ($result === false) { |
|
| 934 | - throw FilesystemException::createFromPhpError(); |
|
| 935 | - } |
|
| 936 | - return $result; |
|
| 927 | + error_clear_last(); |
|
| 928 | + if ($length !== null) { |
|
| 929 | + $result = \fwrite($handle, $string, $length); |
|
| 930 | + } else { |
|
| 931 | + $result = \fwrite($handle, $string); |
|
| 932 | + } |
|
| 933 | + if ($result === false) { |
|
| 934 | + throw FilesystemException::createFromPhpError(); |
|
| 935 | + } |
|
| 936 | + return $result; |
|
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | |
@@ -1023,12 +1023,12 @@ discard block |
||
| 1023 | 1023 | */ |
| 1024 | 1024 | function glob(string $pattern, int $flags = 0): array |
| 1025 | 1025 | { |
| 1026 | - error_clear_last(); |
|
| 1027 | - $result = \glob($pattern, $flags); |
|
| 1028 | - if ($result === false) { |
|
| 1029 | - throw FilesystemException::createFromPhpError(); |
|
| 1030 | - } |
|
| 1031 | - return $result; |
|
| 1026 | + error_clear_last(); |
|
| 1027 | + $result = \glob($pattern, $flags); |
|
| 1028 | + if ($result === false) { |
|
| 1029 | + throw FilesystemException::createFromPhpError(); |
|
| 1030 | + } |
|
| 1031 | + return $result; |
|
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | |
@@ -1047,11 +1047,11 @@ discard block |
||
| 1047 | 1047 | */ |
| 1048 | 1048 | function lchgrp(string $filename, $group): void |
| 1049 | 1049 | { |
| 1050 | - error_clear_last(); |
|
| 1051 | - $result = \lchgrp($filename, $group); |
|
| 1052 | - if ($result === false) { |
|
| 1053 | - throw FilesystemException::createFromPhpError(); |
|
| 1054 | - } |
|
| 1050 | + error_clear_last(); |
|
| 1051 | + $result = \lchgrp($filename, $group); |
|
| 1052 | + if ($result === false) { |
|
| 1053 | + throw FilesystemException::createFromPhpError(); |
|
| 1054 | + } |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | |
@@ -1068,11 +1068,11 @@ discard block |
||
| 1068 | 1068 | */ |
| 1069 | 1069 | function lchown(string $filename, $user): void |
| 1070 | 1070 | { |
| 1071 | - error_clear_last(); |
|
| 1072 | - $result = \lchown($filename, $user); |
|
| 1073 | - if ($result === false) { |
|
| 1074 | - throw FilesystemException::createFromPhpError(); |
|
| 1075 | - } |
|
| 1071 | + error_clear_last(); |
|
| 1072 | + $result = \lchown($filename, $user); |
|
| 1073 | + if ($result === false) { |
|
| 1074 | + throw FilesystemException::createFromPhpError(); |
|
| 1075 | + } |
|
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | 1078 | |
@@ -1086,11 +1086,11 @@ discard block |
||
| 1086 | 1086 | */ |
| 1087 | 1087 | function link(string $target, string $link): void |
| 1088 | 1088 | { |
| 1089 | - error_clear_last(); |
|
| 1090 | - $result = \link($target, $link); |
|
| 1091 | - if ($result === false) { |
|
| 1092 | - throw FilesystemException::createFromPhpError(); |
|
| 1093 | - } |
|
| 1089 | + error_clear_last(); |
|
| 1090 | + $result = \link($target, $link); |
|
| 1091 | + if ($result === false) { |
|
| 1092 | + throw FilesystemException::createFromPhpError(); |
|
| 1093 | + } |
|
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | 1096 | |
@@ -1116,15 +1116,15 @@ discard block |
||
| 1116 | 1116 | */ |
| 1117 | 1117 | function mkdir(string $pathname, int $mode = 0777, bool $recursive = false, $context = null): void |
| 1118 | 1118 | { |
| 1119 | - error_clear_last(); |
|
| 1120 | - if ($context !== null) { |
|
| 1121 | - $result = \mkdir($pathname, $mode, $recursive, $context); |
|
| 1122 | - } else { |
|
| 1123 | - $result = \mkdir($pathname, $mode, $recursive); |
|
| 1124 | - } |
|
| 1125 | - if ($result === false) { |
|
| 1126 | - throw FilesystemException::createFromPhpError(); |
|
| 1127 | - } |
|
| 1119 | + error_clear_last(); |
|
| 1120 | + if ($context !== null) { |
|
| 1121 | + $result = \mkdir($pathname, $mode, $recursive, $context); |
|
| 1122 | + } else { |
|
| 1123 | + $result = \mkdir($pathname, $mode, $recursive); |
|
| 1124 | + } |
|
| 1125 | + if ($result === false) { |
|
| 1126 | + throw FilesystemException::createFromPhpError(); |
|
| 1127 | + } |
|
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | |
@@ -1159,12 +1159,12 @@ discard block |
||
| 1159 | 1159 | */ |
| 1160 | 1160 | function parse_ini_file(string $filename, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array |
| 1161 | 1161 | { |
| 1162 | - error_clear_last(); |
|
| 1163 | - $result = \parse_ini_file($filename, $process_sections, $scanner_mode); |
|
| 1164 | - if ($result === false) { |
|
| 1165 | - throw FilesystemException::createFromPhpError(); |
|
| 1166 | - } |
|
| 1167 | - return $result; |
|
| 1162 | + error_clear_last(); |
|
| 1163 | + $result = \parse_ini_file($filename, $process_sections, $scanner_mode); |
|
| 1164 | + if ($result === false) { |
|
| 1165 | + throw FilesystemException::createFromPhpError(); |
|
| 1166 | + } |
|
| 1167 | + return $result; |
|
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | |
@@ -1196,12 +1196,12 @@ discard block |
||
| 1196 | 1196 | */ |
| 1197 | 1197 | function parse_ini_string(string $ini, bool $process_sections = false, int $scanner_mode = INI_SCANNER_NORMAL): array |
| 1198 | 1198 | { |
| 1199 | - error_clear_last(); |
|
| 1200 | - $result = \parse_ini_string($ini, $process_sections, $scanner_mode); |
|
| 1201 | - if ($result === false) { |
|
| 1202 | - throw FilesystemException::createFromPhpError(); |
|
| 1203 | - } |
|
| 1204 | - return $result; |
|
| 1199 | + error_clear_last(); |
|
| 1200 | + $result = \parse_ini_string($ini, $process_sections, $scanner_mode); |
|
| 1201 | + if ($result === false) { |
|
| 1202 | + throw FilesystemException::createFromPhpError(); |
|
| 1203 | + } |
|
| 1204 | + return $result; |
|
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | 1207 | |
@@ -1218,16 +1218,16 @@ discard block |
||
| 1218 | 1218 | */ |
| 1219 | 1219 | function readfile(string $filename, bool $use_include_path = false, $context = null): int |
| 1220 | 1220 | { |
| 1221 | - error_clear_last(); |
|
| 1222 | - if ($context !== null) { |
|
| 1223 | - $result = \readfile($filename, $use_include_path, $context); |
|
| 1224 | - } else { |
|
| 1225 | - $result = \readfile($filename, $use_include_path); |
|
| 1226 | - } |
|
| 1227 | - if ($result === false) { |
|
| 1228 | - throw FilesystemException::createFromPhpError(); |
|
| 1229 | - } |
|
| 1230 | - return $result; |
|
| 1221 | + error_clear_last(); |
|
| 1222 | + if ($context !== null) { |
|
| 1223 | + $result = \readfile($filename, $use_include_path, $context); |
|
| 1224 | + } else { |
|
| 1225 | + $result = \readfile($filename, $use_include_path); |
|
| 1226 | + } |
|
| 1227 | + if ($result === false) { |
|
| 1228 | + throw FilesystemException::createFromPhpError(); |
|
| 1229 | + } |
|
| 1230 | + return $result; |
|
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | |
@@ -1241,12 +1241,12 @@ discard block |
||
| 1241 | 1241 | */ |
| 1242 | 1242 | function readlink(string $path): string |
| 1243 | 1243 | { |
| 1244 | - error_clear_last(); |
|
| 1245 | - $result = \readlink($path); |
|
| 1246 | - if ($result === false) { |
|
| 1247 | - throw FilesystemException::createFromPhpError(); |
|
| 1248 | - } |
|
| 1249 | - return $result; |
|
| 1244 | + error_clear_last(); |
|
| 1245 | + $result = \readlink($path); |
|
| 1246 | + if ($result === false) { |
|
| 1247 | + throw FilesystemException::createFromPhpError(); |
|
| 1248 | + } |
|
| 1249 | + return $result; |
|
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | |
@@ -1277,12 +1277,12 @@ discard block |
||
| 1277 | 1277 | */ |
| 1278 | 1278 | function realpath(string $path): string |
| 1279 | 1279 | { |
| 1280 | - error_clear_last(); |
|
| 1281 | - $result = \realpath($path); |
|
| 1282 | - if ($result === false) { |
|
| 1283 | - throw FilesystemException::createFromPhpError(); |
|
| 1284 | - } |
|
| 1285 | - return $result; |
|
| 1280 | + error_clear_last(); |
|
| 1281 | + $result = \realpath($path); |
|
| 1282 | + if ($result === false) { |
|
| 1283 | + throw FilesystemException::createFromPhpError(); |
|
| 1284 | + } |
|
| 1285 | + return $result; |
|
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | |
@@ -1306,15 +1306,15 @@ discard block |
||
| 1306 | 1306 | */ |
| 1307 | 1307 | function rename(string $oldname, string $newname, $context = null): void |
| 1308 | 1308 | { |
| 1309 | - error_clear_last(); |
|
| 1310 | - if ($context !== null) { |
|
| 1311 | - $result = \rename($oldname, $newname, $context); |
|
| 1312 | - } else { |
|
| 1313 | - $result = \rename($oldname, $newname); |
|
| 1314 | - } |
|
| 1315 | - if ($result === false) { |
|
| 1316 | - throw FilesystemException::createFromPhpError(); |
|
| 1317 | - } |
|
| 1309 | + error_clear_last(); |
|
| 1310 | + if ($context !== null) { |
|
| 1311 | + $result = \rename($oldname, $newname, $context); |
|
| 1312 | + } else { |
|
| 1313 | + $result = \rename($oldname, $newname); |
|
| 1314 | + } |
|
| 1315 | + if ($result === false) { |
|
| 1316 | + throw FilesystemException::createFromPhpError(); |
|
| 1317 | + } |
|
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | 1320 | |
@@ -1329,11 +1329,11 @@ discard block |
||
| 1329 | 1329 | */ |
| 1330 | 1330 | function rewind($handle): void |
| 1331 | 1331 | { |
| 1332 | - error_clear_last(); |
|
| 1333 | - $result = \rewind($handle); |
|
| 1334 | - if ($result === false) { |
|
| 1335 | - throw FilesystemException::createFromPhpError(); |
|
| 1336 | - } |
|
| 1332 | + error_clear_last(); |
|
| 1333 | + $result = \rewind($handle); |
|
| 1334 | + if ($result === false) { |
|
| 1335 | + throw FilesystemException::createFromPhpError(); |
|
| 1336 | + } |
|
| 1337 | 1337 | } |
| 1338 | 1338 | |
| 1339 | 1339 | |
@@ -1349,15 +1349,15 @@ discard block |
||
| 1349 | 1349 | */ |
| 1350 | 1350 | function rmdir(string $dirname, $context = null): void |
| 1351 | 1351 | { |
| 1352 | - error_clear_last(); |
|
| 1353 | - if ($context !== null) { |
|
| 1354 | - $result = \rmdir($dirname, $context); |
|
| 1355 | - } else { |
|
| 1356 | - $result = \rmdir($dirname); |
|
| 1357 | - } |
|
| 1358 | - if ($result === false) { |
|
| 1359 | - throw FilesystemException::createFromPhpError(); |
|
| 1360 | - } |
|
| 1352 | + error_clear_last(); |
|
| 1353 | + if ($context !== null) { |
|
| 1354 | + $result = \rmdir($dirname, $context); |
|
| 1355 | + } else { |
|
| 1356 | + $result = \rmdir($dirname); |
|
| 1357 | + } |
|
| 1358 | + if ($result === false) { |
|
| 1359 | + throw FilesystemException::createFromPhpError(); |
|
| 1360 | + } |
|
| 1361 | 1361 | } |
| 1362 | 1362 | |
| 1363 | 1363 | |
@@ -1373,11 +1373,11 @@ discard block |
||
| 1373 | 1373 | */ |
| 1374 | 1374 | function symlink(string $target, string $link): void |
| 1375 | 1375 | { |
| 1376 | - error_clear_last(); |
|
| 1377 | - $result = \symlink($target, $link); |
|
| 1378 | - if ($result === false) { |
|
| 1379 | - throw FilesystemException::createFromPhpError(); |
|
| 1380 | - } |
|
| 1376 | + error_clear_last(); |
|
| 1377 | + $result = \symlink($target, $link); |
|
| 1378 | + if ($result === false) { |
|
| 1379 | + throw FilesystemException::createFromPhpError(); |
|
| 1380 | + } |
|
| 1381 | 1381 | } |
| 1382 | 1382 | |
| 1383 | 1383 | |
@@ -1395,12 +1395,12 @@ discard block |
||
| 1395 | 1395 | */ |
| 1396 | 1396 | function tempnam(string $dir, string $prefix): string |
| 1397 | 1397 | { |
| 1398 | - error_clear_last(); |
|
| 1399 | - $result = \tempnam($dir, $prefix); |
|
| 1400 | - if ($result === false) { |
|
| 1401 | - throw FilesystemException::createFromPhpError(); |
|
| 1402 | - } |
|
| 1403 | - return $result; |
|
| 1398 | + error_clear_last(); |
|
| 1399 | + $result = \tempnam($dir, $prefix); |
|
| 1400 | + if ($result === false) { |
|
| 1401 | + throw FilesystemException::createFromPhpError(); |
|
| 1402 | + } |
|
| 1403 | + return $result; |
|
| 1404 | 1404 | } |
| 1405 | 1405 | |
| 1406 | 1406 | |
@@ -1420,12 +1420,12 @@ discard block |
||
| 1420 | 1420 | */ |
| 1421 | 1421 | function tmpfile() |
| 1422 | 1422 | { |
| 1423 | - error_clear_last(); |
|
| 1424 | - $result = \tmpfile(); |
|
| 1425 | - if ($result === false) { |
|
| 1426 | - throw FilesystemException::createFromPhpError(); |
|
| 1427 | - } |
|
| 1428 | - return $result; |
|
| 1423 | + error_clear_last(); |
|
| 1424 | + $result = \tmpfile(); |
|
| 1425 | + if ($result === false) { |
|
| 1426 | + throw FilesystemException::createFromPhpError(); |
|
| 1427 | + } |
|
| 1428 | + return $result; |
|
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | |
@@ -1450,17 +1450,17 @@ discard block |
||
| 1450 | 1450 | */ |
| 1451 | 1451 | function touch(string $filename, int $time = null, int $atime = null): void |
| 1452 | 1452 | { |
| 1453 | - error_clear_last(); |
|
| 1454 | - if ($atime !== null) { |
|
| 1455 | - $result = \touch($filename, $time, $atime); |
|
| 1456 | - } elseif ($time !== null) { |
|
| 1457 | - $result = \touch($filename, $time); |
|
| 1458 | - } else { |
|
| 1459 | - $result = \touch($filename); |
|
| 1460 | - } |
|
| 1461 | - if ($result === false) { |
|
| 1462 | - throw FilesystemException::createFromPhpError(); |
|
| 1463 | - } |
|
| 1453 | + error_clear_last(); |
|
| 1454 | + if ($atime !== null) { |
|
| 1455 | + $result = \touch($filename, $time, $atime); |
|
| 1456 | + } elseif ($time !== null) { |
|
| 1457 | + $result = \touch($filename, $time); |
|
| 1458 | + } else { |
|
| 1459 | + $result = \touch($filename); |
|
| 1460 | + } |
|
| 1461 | + if ($result === false) { |
|
| 1462 | + throw FilesystemException::createFromPhpError(); |
|
| 1463 | + } |
|
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | |
@@ -1476,13 +1476,13 @@ discard block |
||
| 1476 | 1476 | */ |
| 1477 | 1477 | function unlink(string $filename, $context = null): void |
| 1478 | 1478 | { |
| 1479 | - error_clear_last(); |
|
| 1480 | - if ($context !== null) { |
|
| 1481 | - $result = \unlink($filename, $context); |
|
| 1482 | - } else { |
|
| 1483 | - $result = \unlink($filename); |
|
| 1484 | - } |
|
| 1485 | - if ($result === false) { |
|
| 1486 | - throw FilesystemException::createFromPhpError(); |
|
| 1487 | - } |
|
| 1479 | + error_clear_last(); |
|
| 1480 | + if ($context !== null) { |
|
| 1481 | + $result = \unlink($filename, $context); |
|
| 1482 | + } else { |
|
| 1483 | + $result = \unlink($filename); |
|
| 1484 | + } |
|
| 1485 | + if ($result === false) { |
|
| 1486 | + throw FilesystemException::createFromPhpError(); |
|
| 1487 | + } |
|
| 1488 | 1488 | } |
@@ -68,15 +68,15 @@ |
||
| 68 | 68 | */ |
| 69 | 69 | function error_log(string $message, int $message_type = 0, string $destination = null, string $extra_headers = null): void |
| 70 | 70 | { |
| 71 | - error_clear_last(); |
|
| 72 | - if ($extra_headers !== null) { |
|
| 73 | - $result = \error_log($message, $message_type, $destination, $extra_headers); |
|
| 74 | - } elseif ($destination !== null) { |
|
| 75 | - $result = \error_log($message, $message_type, $destination); |
|
| 76 | - } else { |
|
| 77 | - $result = \error_log($message, $message_type); |
|
| 78 | - } |
|
| 79 | - if ($result === false) { |
|
| 80 | - throw ErrorfuncException::createFromPhpError(); |
|
| 81 | - } |
|
| 71 | + error_clear_last(); |
|
| 72 | + if ($extra_headers !== null) { |
|
| 73 | + $result = \error_log($message, $message_type, $destination, $extra_headers); |
|
| 74 | + } elseif ($destination !== null) { |
|
| 75 | + $result = \error_log($message, $message_type, $destination); |
|
| 76 | + } else { |
|
| 77 | + $result = \error_log($message, $message_type); |
|
| 78 | + } |
|
| 79 | + if ($result === false) { |
|
| 80 | + throw ErrorfuncException::createFromPhpError(); |
|
| 81 | + } |
|
| 82 | 82 | } |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class PsException extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |
@@ -3,9 +3,9 @@ |
||
| 3 | 3 | |
| 4 | 4 | class FtpException extends \ErrorException implements SafeExceptionInterface |
| 5 | 5 | { |
| 6 | - public static function createFromPhpError(): self |
|
| 7 | - { |
|
| 8 | - $error = error_get_last(); |
|
| 9 | - return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | - } |
|
| 6 | + public static function createFromPhpError(): self |
|
| 7 | + { |
|
| 8 | + $error = error_get_last(); |
|
| 9 | + return new self($error['message'] ?? 'An error occured', 0, $error['type'] ?? 1); |
|
| 10 | + } |
|
| 11 | 11 | } |