Stock/Model/StockAdjustmentReasons.php
static public function isValidReason($reason, $throw = true)
    {
        if (in_array($reason, static::getReasons(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Invalid stock adjustment reason.");
        }

        return false;
    }
static public function isValidReason($reason, $throw = true)
    {
        if (in_array($reason, static::getReasons(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Invalid stock adjustment reason.");
        }

        return false;
    }
Returns whether the given reason is valid or not.

@param string $reason
@param bool $throw

@return bool