Migrated UrlShortenerOptions to immutable object

This commit is contained in:
Alejandro Celaya
2022-09-17 15:54:43 +02:00
parent 42af057316
commit 8d244c8d34
10 changed files with 58 additions and 113 deletions

View File

@@ -46,11 +46,11 @@ class UrlValidator implements UrlValidatorInterface, RequestMethodInterface
public function validateUrlWithTitle(string $url, bool $doValidate): ?string
{
if (! $doValidate && ! $this->options->autoResolveTitles()) {
if (! $doValidate && ! $this->options->autoResolveTitles) {
return null;
}
if (! $this->options->autoResolveTitles()) {
if (! $this->options->autoResolveTitles) {
$this->validateUrlAndGetResponse($url, self::METHOD_HEAD);
return null;
}