public static implementsInterface ( $value, $interface, $message = '' ) |
public static function implementsInterface($value, $interface, $message = '')
{
if (!in_array($interface, class_implements($value))) {
static::reportInvalidArgument(sprintf($message ?: 'Expected an implementation of %2$s. Got: %s', static::valueToString($value), static::valueToString($interface)));
}
}
/** * @param PromotionSubjectInterface $subject * * @return bool */ protected function isSubjectValid(PromotionSubjectInterface $subject) { Assert::implementsInterface($subject, OrderInterface::class); return 0 !== $subject->countItems(); }