Change variable name for validation enabled.

This commit is contained in:
Mikolaj Gogula 2017-10-17 11:44:30 +02:00
parent fef5390a62
commit 297c88c334
2 changed files with 8 additions and 8 deletions

View file

@ -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);
} }

View file

@ -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
); );
} }