function PerformanceTestRecorder::getCount

Same name in other branches
  1. 9 core/lib/Drupal/Core/Test/PerformanceTestRecorder.php \Drupal\Core\Test\PerformanceTestRecorder::getCount()
  2. 11.x core/lib/Drupal/Core/Test/PerformanceTestRecorder.php \Drupal\Core\Test\PerformanceTestRecorder::getCount()

File

core/lib/Drupal/Core/Test/PerformanceTestRecorder.php, line 43

Class

PerformanceTestRecorder
Records the number of times specific events occur.

Namespace

Drupal\Core\Test

Code

public function getCount(string $type, string $name) : int {
    $count = 0;
    if ($this->state) {
        $record = $this->state
            ->get('drupal.performance_test_recorder', []);
        $count += $record[$type][$name] ?? 0;
    }
    $count += self::$record[$type][$name] ?? 0;
    return $count;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.