Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestLogger.php

function TestLogger::hasRecordThatPasses

Parameters

callable(array<string, mixed>, int): bool $predicate:

3 calls to TestLogger::hasRecordThatPasses()
TestLogger::hasRecord in vendor/colinodell/psr-testlogger/src/TestLogger.php
TestLogger::hasRecordThatContains in vendor/colinodell/psr-testlogger/src/TestLogger.php
TestLogger::hasRecordThatMatches in vendor/colinodell/psr-testlogger/src/TestLogger.php

File

vendor/colinodell/psr-testlogger/src/TestLogger.php, line 133

Class

TestLogger
Used for testing purposes.

Namespace

ColinODell\PsrTestLogger

Code

public function hasRecordThatPasses(callable $predicate, string|int|null $level = null) : bool {
    if (!$this->hasRecords($level)) {
        return false;
    }
    foreach ($level === null ? $this->records : $this->recordsByLevel[$level] as $i => $rec) {
        if (\call_user_func($predicate, $rec, $i)) {
            return true;
        }
    }
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal