Skip to content

Commit

Permalink
updating components to helper class
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Apr 29, 2024
1 parent 172aabe commit 6d8ee42
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Editor/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use EightshiftForms\CustomPostType\Forms;
use EightshiftFormsVendor\EightshiftFormsUtils\Config\UtilsConfig;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsGeneralHelper;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Components;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Helpers;
use EightshiftFormsVendor\EightshiftLibs\Services\ServiceInterface;

/**
Expand All @@ -39,7 +39,7 @@ public function register(): void
*/
public function getEditorBackLink(): void
{
$actualUrl = Components::getCurrentUrl();
$actualUrl = Helpers::getCurrentUrl();

$types = [
Forms::POST_TYPE_SLUG,
Expand Down
8 changes: 4 additions & 4 deletions src/Integrations/Hubspot/HubspotClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsDeveloperHelper;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsHelper;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsHooksHelper;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Components;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Helpers;

/**
* HubspotClient integration class.
Expand Down Expand Up @@ -221,7 +221,7 @@ public function postApplication(string $itemId, array $params, array $files, str
'context' => [
'ipAddress' => $this->security->getIpAddress(),
'hutk' => $params[UtilsHelper::getStateParam('hubspotCookie')]['value'],
'pageUri' => Components::cleanUrlParams($params[UtilsHelper::getStateParam('hubspotPageUrl')]['value']),
'pageUri' => Helpers::cleanUrlParams($params[UtilsHelper::getStateParam('hubspotPageUrl')]['value']),
'pageName' => $params[UtilsHelper::getStateParam('hubspotPageName')]['value'],
],
];
Expand Down Expand Up @@ -297,7 +297,7 @@ public function postContactProperty(string $email, array $params): array
{
$properties = [];

$customFields = \array_flip(Components::flattenArray(UtilsHelper::getStateParams()));
$customFields = \array_flip(Helpers::flattenArray(UtilsHelper::getStateParams()));

if ($params) {
foreach ($params as $key => $value) {
Expand Down Expand Up @@ -649,7 +649,7 @@ static function ($item) {
$consentData = $consentData[0] ?? '';

// Validate if json.
if (!Components::isJson($consentData)) {
if (!Helpers::isJson($consentData)) {
return [];
}

Expand Down
5 changes: 2 additions & 3 deletions src/Integrations/Mailer/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use EightshiftFormsVendor\EightshiftFormsUtils\Config\UtilsConfig;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsHooksHelper;
use EightshiftForms_Parsedown as Parsedown;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Components;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Helpers;

/**
Expand Down Expand Up @@ -141,7 +140,7 @@ public function fallbackIntegrationEmail(
}
break;
default:
$filesOutput = Components::recursiveArrayFind($files, 'path');
$filesOutput = Helpers::recursiveArrayFind($files, 'path');
break;
}
}
Expand Down Expand Up @@ -222,7 +221,7 @@ public function fallbackProcessingEmail(
}
break;
default:
$filesOutput = Components::recursiveArrayFind($files, 'path');
$filesOutput = Helpers::recursiveArrayFind($files, 'path');
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Settings/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use EightshiftFormsVendor\EightshiftFormsUtils\Config\UtilsConfig;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsSettingsHelper;
use EightshiftFormsVendor\EightshiftFormsUtils\Helpers\UtilsHelper;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Components;
use EightshiftFormsVendor\EightshiftLibs\Helpers\Helpers;

/**
* Settings class.
Expand Down Expand Up @@ -112,7 +112,7 @@ public function getSettingsForm(string $type, string $formId): string
UtilsHelper::getStateAttribute('formId') => $formId,
UtilsHelper::getStateAttribute('formType') => $internalType,
UtilsHelper::getStateAttribute('settingsType') => $type,
UtilsHelper::getStateAttribute('successRedirect') => Components::getCurrentUrl(),
UtilsHelper::getStateAttribute('successRedirect') => Helpers::getCurrentUrl(),
];

// Populate and build form.
Expand Down

0 comments on commit 6d8ee42

Please sign in to comment.