public function doValidate($validator, $values) { preg_match(ForgeValidatorGitHubUrl::PATTERN, $values['url'], $parts); $url = sprintf('http://github.com/%s/%s/', $parts[3], $parts[4]); if (!ForgeToolkit::isUrlAccessible($url)) { throw new sfValidatorError($validator, sprintf('Could not access <a href="%s">GitHub URL</a> (404)', $url)); } $this->gitHubUser = $parts[3]; $this->gitHubRepository = $parts[4]; return $values; }