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

Breadcrumb

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

function Duration::ensureNotNegative

Throws

InvalidArgumentException

1 call to Duration::ensureNotNegative()
Duration::__construct in vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php

File

vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php, line 125

Class

Duration
@psalm-immutable

Namespace

PHPUnit\Event\Telemetry

Code

private function ensureNotNegative(int $value, string $type) : void {
    if ($value < 0) {
        throw new InvalidArgumentException(sprintf('Value for %s must not be negative.', $type));
    }
}

API Navigation

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