Webmozart\Assert\Assert::notSame PHP Method

notSame() public static method

public static notSame ( $value, $value2, $message = '' )
    public static function notSame($value, $value2, $message = '')
    {
        if ($value2 === $value) {
            static::reportInvalidArgument(sprintf($message ?: 'Expected a value not identical to %s.', static::valueToString($value2)));
        }
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function format($amount, $currency, $locale = 'en')
 {
     $formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
     $result = $formatter->formatCurrency($amount / 100, $currency);
     Assert::notSame(false, $result, sprintf('The amount "%s" of type %s cannot be formatted to currency "%s".', $amount, gettype($amount), $currency));
     return $result;
 }
All Usage Examples Of Webmozart\Assert\Assert::notSame