Skip to content

Commit

Permalink
Replace getParameter for get
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Jul 5, 2020
1 parent ae6cb63 commit e32eafb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Controller/Api/LimiterApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getStyleAction()
*/
private function getViewFromLimiter($key)
{
$limiter = $this->coreParametersHelper->getParameter('limiter');
$limiter = $this->coreParametersHelper->get('limiter');
$view = $this->view(['response' => ArrayHelper::getValue($key, $limiter)]);

return $this->handleView($view);
Expand All @@ -92,7 +92,7 @@ private function getViewFromLimiter($key)
*/
public function getAction()
{
$limiter = $this->coreParametersHelper->getParameter('limiter');
$limiter = $this->coreParametersHelper->get('limiter');
if (isset($limiter[self::API_SECRET_KEY])) {
unset($limiter[self::API_SECRET_KEY]);
}
Expand Down Expand Up @@ -147,7 +147,7 @@ private function processUpdate($key)

return $this->handleView($view);
}
$limiter = $this->coreParametersHelper->getParameter('limiter');
$limiter = $this->coreParametersHelper->get('limiter');

$apiSecretKeyFromRequest = ArrayHelper::getValue(self::API_SECRET_KEY, $all);
if (is_null($apiSecretKeyFromRequest)) {
Expand Down Expand Up @@ -175,7 +175,7 @@ private function processUpdate($key)
$toUpdate = ['limiter' => $limiter];
$this->configurator->mergeParameters($toUpdate);
$this->configurator->write();
$this->filesystem->remove($this->coreParametersHelper->getParameter('kernel.cache_dir'));
$this->filesystem->remove($this->coreParametersHelper->get('kernel.cache_dir'));
$view = $this->view(['success' => '1'], Codes::HTTP_OK);

return $this->handleView($view);
Expand Down
2 changes: 1 addition & 1 deletion Integration/LimiterSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LimiterSettings
*/
public function __construct(CoreParametersHelper $coreParametersHelper, Connection $connection)
{
$limiter = $coreParametersHelper->getParameter('limiter', []);
$limiter = $coreParametersHelper->get('limiter', []);
$this->limit = (int) ArrayHelper::getValue('limit', $limiter, 0);
$this->message = (string) ArrayHelper::getValue('message', $limiter, '');
$this->style = (string) ArrayHelper::getValue('style', $limiter, '');
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Limiter for Mautic
# Limiter for Mautic 3

_If you're interest Limiter for Mautic 2, please contact me._

This plugin disable Mautic features after extend limit of number of identified contacts. You can hide create new contact, new email, campaigns or editation too.

Expand Down

0 comments on commit e32eafb

Please sign in to comment.