PCOV.php 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of the php-code-coverage package.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace SebastianBergmann\CodeCoverage\Driver;
  11. /**
  12. * Driver for PCOV code coverage functionality.
  13. *
  14. * @codeCoverageIgnore
  15. */
  16. final class PCOV implements Driver
  17. {
  18. /**
  19. * Start collection of code coverage information.
  20. */
  21. public function start(bool $determineUnusedAndDead = true): void
  22. {
  23. \pcov\start();
  24. }
  25. /**
  26. * Stop collection of code coverage information.
  27. */
  28. public function stop(): array
  29. {
  30. \pcov\stop();
  31. $waiting = \pcov\waiting();
  32. $collect = [];
  33. if ($waiting) {
  34. $collect = \pcov\collect(\pcov\inclusive, $waiting);
  35. \pcov\clear();
  36. }
  37. return $collect;
  38. }
  39. }