This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/lib/PayPal/Validation/UrlValidator.php
japatel 61a52e4623 Enabled EC Parameters support
- Updated Api to enabled EC Parameters
- Updated Tests
- Updated Logging Manager
- Added a feature to do validation on accessors.
2014-10-10 10:50:49 -05:00

26 lines
568 B
PHP

<?php
namespace PayPal\Validation;
/**
* Class UrlValidator
*
* @package PayPal\Validation
*/
class UrlValidator
{
/**
* Helper method for validating URLs that will be used by this API in any requests.
*
* @param $url
* @param string|null $urlName
* @throws \InvalidArgumentException
*/
public static function validate($url, $urlName = null)
{
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new \InvalidArgumentException("$urlName is not a fully qualified URL");
}
}
}