You are here

private function PHP_CodeCoverage_Report_HTML::getDirectory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php \PHP_CodeCoverage_Report_HTML::getDirectory()

@since Method available since Release 1.2.0

Parameters

string $directory:

Return value

string

Throws

PHP_CodeCoverage_Exception

2 calls to PHP_CodeCoverage_Report_HTML::getDirectory()
PHP_CodeCoverage_Report_HTML::copyFiles in vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php
PHP_CodeCoverage_Report_HTML::process in vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php

File

vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php, line 161

Class

PHP_CodeCoverage_Report_HTML
Generates an HTML report from an PHP_CodeCoverage object.

Code

private function getDirectory($directory) {
  if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) {
    $directory .= DIRECTORY_SEPARATOR;
  }
  if (is_dir($directory)) {
    return $directory;
  }
  if (@mkdir($directory, 0777, true)) {
    return $directory;
  }
  throw new PHP_CodeCoverage_Exception(sprintf('Directory "%s" does not exist.', $directory));
}