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

Breadcrumb

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

function Assert::eq

Parameters

mixed $value:

mixed $expect:

string $message:

Throws

InvalidArgumentException

1 call to Assert::eq()
Assert::count in vendor/webmozart/assert/src/Assert.php
Does not check if $array is countable, this can generate a warning on php versions after 7.2.

File

vendor/webmozart/assert/src/Assert.php, line 774

Class

Assert
Efficient assertions to validate the input/output of your methods.

Namespace

Webmozart\Assert

Code

public static function eq($value, $expect, $message = '') {
    if ($expect != $value) {
        static::reportInvalidArgument(\sprintf($message ?: 'Expected a value equal to %2$s. Got: %s', static::valueToString($value), static::valueToString($expect)));
    }
}

API Navigation

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