You are here

public function Snapshot::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/sebastian/global-state/src/Snapshot.php \SebastianBergmann\GlobalState\Snapshot::__construct()

Creates a snapshot of the current global state.

Parameters

Blacklist $blacklist:

boolean $includeGlobalVariables:

boolean $includeStaticAttributes:

boolean $includeConstants:

boolean $includeFunctions:

boolean $includeClasses:

boolean $includeInterfaces:

boolean $includeTraits:

boolean $includeIniSettings:

boolean $includeIncludedFiles:

File

vendor/sebastian/global-state/src/Snapshot.php, line 132

Class

Snapshot
A snapshot of global state.

Namespace

SebastianBergmann\GlobalState

Code

public function __construct(Blacklist $blacklist = null, $includeGlobalVariables = true, $includeStaticAttributes = true, $includeConstants = true, $includeFunctions = true, $includeClasses = true, $includeInterfaces = true, $includeTraits = true, $includeIniSettings = true, $includeIncludedFiles = true) {
  if ($blacklist === null) {
    $blacklist = new Blacklist();
  }
  $this->blacklist = $blacklist;
  if ($includeConstants) {
    $this
      ->snapshotConstants();
  }
  if ($includeFunctions) {
    $this
      ->snapshotFunctions();
  }
  if ($includeClasses || $includeStaticAttributes) {
    $this
      ->snapshotClasses();
  }
  if ($includeInterfaces) {
    $this
      ->snapshotInterfaces();
  }
  if ($includeGlobalVariables) {
    $this
      ->setupSuperGlobalArrays();
    $this
      ->snapshotGlobals();
  }
  if ($includeStaticAttributes) {
    $this
      ->snapshotStaticAttributes();
  }
  if ($includeIniSettings) {
    $this->iniSettings = ini_get_all(null, false);
  }
  if ($includeIncludedFiles) {
    $this->includedFiles = get_included_files();
  }
  if (function_exists('get_declared_traits')) {
    $this->traits = get_declared_traits();
  }
}