MimeType::equals( self|string $other ): bool

In this article

Checks if this MIME type equals another.

Parameters

$otherself|stringrequired
The other MIME type to compare.

Return

bool True if equal.

Source

public function equals($other): bool
{
    if ($other instanceof self) {
        return $this->value === $other->value;
    }
    if (is_string($other)) {
        return $this->value === strtolower($other);
    }
    throw new InvalidArgumentException(sprintf('Invalid MIME type comparison: %s', gettype($other)));
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.