mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-27 20:11:34 +03:00
Change variable name for validation enabled.
This commit is contained in:
parent
fef5390a62
commit
297c88c334
2 changed files with 8 additions and 8 deletions
|
@ -39,14 +39,14 @@ class UrlShortener implements UrlShortenerInterface
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
private $isUrlExistsValidation;
|
private $urlValidationEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UrlShortener constructor.
|
* UrlShortener constructor.
|
||||||
* @param ClientInterface $httpClient
|
* @param ClientInterface $httpClient
|
||||||
* @param EntityManagerInterface $em
|
* @param EntityManagerInterface $em
|
||||||
* @param Cache $cache
|
* @param Cache $cache
|
||||||
* @param bool $isUrlExistsValidation
|
* @param bool $urlValidationEnabled
|
||||||
* @param string $chars
|
* @param string $chars
|
||||||
*
|
*
|
||||||
* @Inject({
|
* @Inject({
|
||||||
|
@ -61,14 +61,14 @@ class UrlShortener implements UrlShortenerInterface
|
||||||
ClientInterface $httpClient,
|
ClientInterface $httpClient,
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
Cache $cache,
|
Cache $cache,
|
||||||
$isUrlExistsValidation,
|
$urlValidationEnabled,
|
||||||
$chars = self::DEFAULT_CHARS
|
$chars = self::DEFAULT_CHARS
|
||||||
) {
|
) {
|
||||||
$this->httpClient = $httpClient;
|
$this->httpClient = $httpClient;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->chars = empty($chars) ? self::DEFAULT_CHARS : $chars;
|
$this->chars = empty($chars) ? self::DEFAULT_CHARS : $chars;
|
||||||
$this->cache = $cache;
|
$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
|
// Check if the validation of url is enabled in the config
|
||||||
if (true === $this->isUrlExistsValidation) {
|
if (true === $this->urlValidationEnabled) {
|
||||||
// Check that the URL exists
|
// Check that the URL exists
|
||||||
$this->checkUrlExists($url);
|
$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->urlShortener = new UrlShortener(
|
||||||
$this->httpClient->reveal(),
|
$this->httpClient->reveal(),
|
||||||
$this->em->reveal(),
|
$this->em->reveal(),
|
||||||
$this->cache,
|
$this->cache,
|
||||||
$isUrlValidationExists,
|
$urlValidationEnabled,
|
||||||
UrlShortener::DEFAULT_CHARS
|
UrlShortener::DEFAULT_CHARS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue