mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-24 09:50:17 -06:00
Change variable name for validation enabled.
This commit is contained in:
parent
fef5390a62
commit
297c88c334
@ -39,14 +39,14 @@ class UrlShortener implements UrlShortenerInterface
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $isUrlExistsValidation;
|
||||
private $urlValidationEnabled;
|
||||
|
||||
/**
|
||||
* UrlShortener constructor.
|
||||
* @param ClientInterface $httpClient
|
||||
* @param EntityManagerInterface $em
|
||||
* @param Cache $cache
|
||||
* @param bool $isUrlExistsValidation
|
||||
* @param bool $urlValidationEnabled
|
||||
* @param string $chars
|
||||
*
|
||||
* @Inject({
|
||||
@ -61,14 +61,14 @@ class UrlShortener implements UrlShortenerInterface
|
||||
ClientInterface $httpClient,
|
||||
EntityManagerInterface $em,
|
||||
Cache $cache,
|
||||
$isUrlExistsValidation,
|
||||
$urlValidationEnabled,
|
||||
$chars = self::DEFAULT_CHARS
|
||||
) {
|
||||
$this->httpClient = $httpClient;
|
||||
$this->em = $em;
|
||||
$this->chars = empty($chars) ? self::DEFAULT_CHARS : $chars;
|
||||
$this->cache = $cache;
|
||||
$this->isUrlExistsValidation = $isUrlExistsValidation;
|
||||
$this->urlValidationEnabled = $urlValidationEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,7 +91,7 @@ class UrlShortener implements UrlShortenerInterface
|
||||
}
|
||||
|
||||
// Check if the validation of url is enabled in the config
|
||||
if (true === $this->isUrlExistsValidation) {
|
||||
if (true === $this->urlValidationEnabled) {
|
||||
// Check that the URL exists
|
||||
$this->checkUrlExists($url);
|
||||
}
|
||||
|
@ -62,15 +62,15 @@ class UrlShortenerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isUrlValidationExists
|
||||
* @param bool $urlValidationEnabled
|
||||
*/
|
||||
public function setUrlShortener($isUrlValidationExists)
|
||||
public function setUrlShortener($urlValidationEnabled)
|
||||
{
|
||||
$this->urlShortener = new UrlShortener(
|
||||
$this->httpClient->reveal(),
|
||||
$this->em->reveal(),
|
||||
$this->cache,
|
||||
$isUrlValidationExists,
|
||||
$urlValidationEnabled,
|
||||
UrlShortener::DEFAULT_CHARS
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user