Assert that two values are equal (using == ).

@param mixed $value
@param mixed $value2
@param string $message
@param string $propertyPath
@return void
@throws Exception
11954
static public function eq($value, $value2, $message = null, $propertyPath = null)
        {
            if ($value != $value2) {
                $message = $message ?: sprintf(
                    'Value "%s" does not equal expected value "%s".',
                    static::stringify($value),
                    static::stringify($value2)
                );

                throw static::createException($value, $message, static::INVALID_EQ, $propertyPath, array('expected' => $value2));
            }
        }
1045022
public static function isModulus(
        float $value,
        float $modulo,
        ?string $message = null,
        ?string $propertyPath = null
    ) : void {
        static::numeric($value);
        static::numeric($modulo);

        if ($value % $modulo !== 0) {
            $message = sprintf(
                $message ?: 'Value %d is not a modulus of %d',
                static::stringify($value),
                static::stringify($modulo)
            );

            throw static::createException($value, $message, static::INVALID_MODULUS, $propertyPath);
        }
    }
1275178
public static function areEqual($value1, $value2) : bool
    {
        return $value1 === $value2 || self::hash($value1) === self::hash($value2);
    }
1191827
public function assertIsArray($value, $message='%s must be an Array', $exception='Asserts')
    {
        if (isset($value) === false || is_array($value) === false) {
            $this->throwException($exception, $message, $value);
        }
    }
909768
public function assertIsEqual($value1, $value2, $message='%s and %s must be equal', $exception='Asserts')
    {
        if ($value1 !== $value2) {
            $this->throwException($exception, $message, array($value1, $value2));
        }
    }
342032
static protected function createException($value, $message, $code, $propertyPath, array $constraints = array())
        {
            $constraintString = 'Constraints: ';

            if (count($constraints)) {
                foreach ($constraints as $key => $v) {
                    $constraintString .= "$key => $v, ";
                }

                $constraintString = substr($$constraintString, 0, -2);
            }

            return new Exception("$message => $code => $value => $propertyPath => $constraintString");
        }
472900
static public function notSame($value1, $value2, $message = null, $propertyPath = null)
        {
            if ($value1 === $value2) {
                $message = $message ?: sprintf(
                    'Value "%s" is the same as expected value "%s".',
                    static::stringify($value1),
                    static::stringify($value2)
                );

                throw static::createException($value1, $message, static::INVALID_NOT_SAME, $propertyPath, array('expected' => $value2));
            }
        }
1113330
static public function range($value, $minValue, $maxValue, $message = null, $propertyPath = null)
        {
            static::integer($value);

            if ($value < $minValue || $value > $maxValue) {
                $message = $message ?: sprintf(
                    'Number "%s" was expected to be at least "%d" and at most "%d".',
                    static::stringify($value),
                    static::stringify($minValue),
                    static::stringify($maxValue)
                );

                throw static::createException($value, $message, static::INVALID_RANGE, $propertyPath, array('min' => $minValue, 'max' => $maxValue));
            }
        }
735916
static public function min($value, $minValue, $message = null, $propertyPath = null)
        {
            static::integer($value);

            if ($value < $minValue) {
                $message = $message ?: sprintf(
                    'Number "%s" was expected to be at least "%d".',
                    static::stringify($value),
                    static::stringify($minValue)
                );

                throw static::createException($value, $message, static::INVALID_MIN, $propertyPath, array('min' => $minValue));
            }
        }
700419
static public function boolean($value, $message = null, $propertyPath = null)
        {
            if ( ! is_bool($value)) {
                $message = $message ?: sprintf(
                    'Value "%s" is not a boolean.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_BOOLEAN, $propertyPath);
            }
        }
1316502
static public function notBlank($value, $message = null, $propertyPath = null)
        {
            if (false === $value || (empty($value) && '0' != $value)) {
                $message = $message ?: sprintf(
                    'Value "%s" is blank, but was expected to contain a value.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_NOT_BLANK, $propertyPath);
            }
        }
1008555
static public function subclassOf($value, $className, $message = null, $propertyPath = null)
        {
            if (!is_subclass_of($value, $className)) {
                $message = $message ?: sprintf(
                    'Class "%s" was expected to be subclass of "%s".',
                    static::stringify($value),
                    $className
                );

                throw static::createException($value, $message, static::INVALID_SUBCLASS_OF, $propertyPath, array('class' => $className));
            }
        }
1047572
public function assertIsNull($value, $message='Unexpected null value: %s', $exception='Asserts')
    {
        if (is_null($value)) {
            $value = 'NULL';
            $this->throwException($exception, $message, $value);
        }
    }
1020857
static public function choice($value, array $choices, $message = null, $propertyPath = null)
        {
            if (!Arrays::in($value, $choices, true)) {
                $message = $message ?: sprintf(
                    'Value "%s" is not an element of the valid values: %s',
                    static::stringify($value),
                    implode(", ", array_map('Assert\Assertion::stringify', $choices))
                );

                throw static::createException($value, $message, static::INVALID_CHOICE, $propertyPath, array('choices' => $choices));
            }
        }
665026
static public function alnum($value, $message = null, $propertyPath = null)
        {
            try {
                static::regex($value, '(^([a-zA-Z]{1}[a-zA-Z0-9]*)$)');
            } catch(AssertionFailedException $e) {
                $message = $message ?: sprintf(
                    'Value "%s" is not alphanumeric, starting with letters and containing only letters and numbers.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_ALNUM, $propertyPath);
            }
        }
810917
static public function notEmpty($value, $message = null, $propertyPath = null)
        {
            if (empty($value)) {
                $message = $message ?: sprintf(
                    'Value "%s" is empty, but non empty value was expected.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::VALUE_EMPTY, $propertyPath);
            }
        }
557754
private function assertArrayValue($value, $message = null)
    {
        if (!is_array($value)) {
            return $this->failedAssert(sprintf('value is an array, got "%s".', is_object($value) ? get_class($value) : gettype($value)), $message);
        }

        return true;
    }