[a-z-_]+-\d+)';
+ private const string NAMESPACE = 'smartling-connector/v2';
private ContentHelper $contentHelper;
private FileUriHelper $fileUriHelper;
diff --git a/inc/Smartling/Services/BaseAjaxServiceAbstract.php b/inc/Smartling/Services/BaseAjaxServiceAbstract.php
index 62e21128..66199b97 100644
--- a/inc/Smartling/Services/BaseAjaxServiceAbstract.php
+++ b/inc/Smartling/Services/BaseAjaxServiceAbstract.php
@@ -12,8 +12,8 @@ abstract class BaseAjaxServiceAbstract implements WPHookInterface
*/
const ACTION_NAME = 'service-id';
- public const RESPONSE_FAILED = 'FAILED';
- public const RESPONSE_SUCCESS = 'SUCCESS';
+ public const string RESPONSE_FAILED = 'FAILED';
+ public const string RESPONSE_SUCCESS = 'SUCCESS';
protected array $requestData;
diff --git a/inc/Smartling/Services/ContentRelationsDiscoveryService.php b/inc/Smartling/Services/ContentRelationsDiscoveryService.php
index 4f3cc3e3..6280bd9f 100644
--- a/inc/Smartling/Services/ContentRelationsDiscoveryService.php
+++ b/inc/Smartling/Services/ContentRelationsDiscoveryService.php
@@ -33,6 +33,7 @@
use Smartling\Helpers\WordpressFunctionProxyHelper;
use Smartling\Jobs\JobEntity;
use Smartling\Models\IntegerIterator;
+use Smartling\Models\JobInformation;
use Smartling\Models\UserCloneRequest;
use Smartling\Models\DetectedRelations;
use Smartling\Models\GutenbergBlock;
@@ -50,8 +51,8 @@
class ContentRelationsDiscoveryService
{
use LoggerSafeTrait;
- public const POST_BASED_PROCESSOR = 'PostBasedProcessor';
- public const TERM_BASED_PROCESSOR = 'TermBasedProcessor';
+ public const string POST_BASED_PROCESSOR = 'PostBasedProcessor';
+ public const string TERM_BASED_PROCESSOR = 'TermBasedProcessor';
public function __construct(
private AcfDynamicSupport $acfDynamicSupport,
@@ -199,10 +200,11 @@ public function createSubmissions(UserTranslationRequest $request): void
$curBlogId = $this->wordpressProxy->get_current_blog_id();
$profile = $this->settingsManager->getSingleSettingsProfile($curBlogId);
$job = $request->getJobInformation();
- $jobInfo = new JobEntity($job->getName(), $job->getId(), $profile->getProjectId());
+ $jobInfo = new JobEntity($job->name, $job->id, $profile->getProjectId());
if ($request->isBulk()) {
- $this->bulkUpload($request->getJobInformation()->isAuthorize(),
+ $jobInformation = $request->getJobInformation();
+ $this->bulkUpload($jobInformation->authorize,
$request->getIds(),
$request->getContentType(),
$curBlogId,
@@ -237,7 +239,7 @@ public function createSubmissions(UserTranslationRequest $request): void
'sourceBlogId' => $curBlogId,
'sourceId' => $request->getContentId(),
'targetBlogIds' => $request->getTargetBlogIds(),
- ], $jobInfo, $job->isAuthorize());
+ ], $jobInfo, $job->authorize);
} catch (\Exception $e) {
$this->getLogger()->error(sprintf(
'Failed to create audit log record actionType=%s, requestDescription="%s", sourceId=%d, sourceBlogId=%d, errorMessage="%s"',
@@ -309,7 +311,7 @@ public function createSubmissions(UserTranslationRequest $request): void
$profile,
$jobInfo->getJobUid(),
array_values(array_unique($fileUris)),
- $job->isAuthorize(),
+ $job->authorize,
));
}
diff --git a/inc/Smartling/Services/ContentRelationsHandler.php b/inc/Smartling/Services/ContentRelationsHandler.php
index b7da4c3a..4ef350ca 100644
--- a/inc/Smartling/Services/ContentRelationsHandler.php
+++ b/inc/Smartling/Services/ContentRelationsHandler.php
@@ -43,12 +43,12 @@ class ContentRelationsHandler extends BaseAjaxServiceAbstract
{
use LoggerSafeTrait;
- public const ACTION_NAME = 'smartling-get-relations';
+ public const string ACTION_NAME = 'smartling-get-relations';
- public const ACTION_NAME_CREATE_SUBMISSIONS = 'smartling-create-submissions';
+ public const string ACTION_NAME_CREATE_SUBMISSIONS = 'smartling-create-submissions';
- public const FORM_ACTION_CLONE = 'clone';
- public const FORM_ACTION_UPLOAD = 'upload';
+ public const string FORM_ACTION_CLONE = 'clone';
+ public const string FORM_ACTION_UPLOAD = 'upload';
private ContentRelationsDiscoveryService $service;
public function __construct(ContentRelationsDiscoveryService $service)
diff --git a/inc/Smartling/Services/GlobalSettingsManager.php b/inc/Smartling/Services/GlobalSettingsManager.php
index 45eb39b4..14d8c444 100644
--- a/inc/Smartling/Services/GlobalSettingsManager.php
+++ b/inc/Smartling/Services/GlobalSettingsManager.php
@@ -14,8 +14,8 @@ class GlobalSettingsManager
/**
* Disable on-boot self-diagnostics (not recommended)
*/
- private const SELF_CHECK_IDENTIFIER = 'smartling_static_check_disabled';
- private const SELF_CHECK_IDENTIFIER_DEFAULT = 0;
+ private const string SELF_CHECK_IDENTIFIER = 'smartling_static_check_disabled';
+ private const int SELF_CHECK_IDENTIFIER_DEFAULT = 0;
public static function getSkipSelfCheck()
{
@@ -34,8 +34,8 @@ public static function setSkipSelfCheck($value): void
/**
* Disable logging (not recommended)
*/
- private const DISABLE_LOGGING = 'smartling_disable_logging';
- private const DISABLE_LOGGING_DEFAULT = 0;
+ private const string DISABLE_LOGGING = 'smartling_disable_logging';
+ private const int DISABLE_LOGGING_DEFAULT = 0;
public static function getDisableLogging()
{
@@ -54,7 +54,7 @@ public static function setDisableLogging($value): void
/**
* Log file name customization
*/
- private const SMARTLING_CUSTOM_LOG_FILE = 'smartling_log_file';
+ private const string SMARTLING_CUSTOM_LOG_FILE = 'smartling_log_file';
public static function getLogFileSpecDefault(): string
{
@@ -78,7 +78,7 @@ public static function setLogFileSpec(string $value): void
/**
* Logging configuration customization
*/
- private const LOGGING_CUSTOMIZATION = 'smartling_logging_customization';
+ private const string LOGGING_CUSTOMIZATION = 'smartling_logging_customization';
public static function getLoggingCustomizationDefault()
{
@@ -125,7 +125,7 @@ public static function setLoggingCustomization($value): void
/**
* UI settings Table View Page Size, default = 20 (configured via yaml file)
*/
- private const SMARTLING_CUSTOM_PAGE_SIZE = 'smartling_ui_page_size';
+ private const string SMARTLING_CUSTOM_PAGE_SIZE = 'smartling_ui_page_size';
public static function getPageSizeDefault()
{
@@ -151,8 +151,8 @@ public static function getPageSizeRuntime()
return Bootstrap::getContainer()->getParameter('submission.pagesize');
}
- public const SMARTLING_FRONTEND_GENERATE_LOCK_IDS = 'smartling_frontend_generate_lock_ids';
- public const SMARTLING_GENERATE_LOCK_IDS_DEFAULT = "0";
+ public const string SMARTLING_FRONTEND_GENERATE_LOCK_IDS = 'smartling_frontend_generate_lock_ids';
+ public const string SMARTLING_GENERATE_LOCK_IDS_DEFAULT = "0";
public static function isGenerateLockIdsEnabled(): bool
{
@@ -168,8 +168,8 @@ public static function setGenerateLockIdsFrontend(string $value): void
}
}
- public const SMARTLING_RELATED_CONTENT_SELECT_STATE = 'smartling_related_content_select_state';
- public const SMARTLING_RELATED_CHECKBOX_STATE_DEFAULT = 0;
+ public const string SMARTLING_RELATED_CONTENT_SELECT_STATE = 'smartling_related_content_select_state';
+ public const int SMARTLING_RELATED_CHECKBOX_STATE_DEFAULT = 0;
public static function getRelatedContentSelectState(): int
{
@@ -188,8 +188,8 @@ public static function setRelatedContentSelectState(int $value): void
}
}
- private const SMARTLING_FILTER_UI_VISIBLE = 'smartling_filter_ui_visible';
- private const SMARTLING_FILTER_UI_VISIBLE_DEFAULT = 0;
+ private const string SMARTLING_FILTER_UI_VISIBLE = 'smartling_filter_ui_visible';
+ private const int SMARTLING_FILTER_UI_VISIBLE_DEFAULT = 0;
public static function getFilterUiVisible(): int
{
@@ -205,8 +205,8 @@ public static function setFilterUiVisible(int $value): void
}
}
- public const SETTING_REMOVE_ACF_PARSE_SAVE_BLOCKS_FILTER = 'smartling_remove_acf_parse_save_blocks_filter';
- public const SETTING_REMOVE_ACF_PARSE_SAVE_BLOCKS_FILTER_DEFAULT = "1";
+ public const string SETTING_REMOVE_ACF_PARSE_SAVE_BLOCKS_FILTER = 'smartling_remove_acf_parse_save_blocks_filter';
+ public const string SETTING_REMOVE_ACF_PARSE_SAVE_BLOCKS_FILTER_DEFAULT = "1";
public static function isRemoveAcfParseSaveBlocksFilter(): bool
{
@@ -222,8 +222,8 @@ public static function setRemoveAcfParseSaveBlocksFilter(string $value): void
}
}
- public const SETTING_ADD_SLASHES_BEFORE_SAVING_CONTENT = 'smartling_add_slashes_before_saving_content';
- public const SETTING_ADD_SLASHES_BEFORE_SAVING_CONTENT_DEFAULT = "1";
+ public const string SETTING_ADD_SLASHES_BEFORE_SAVING_CONTENT = 'smartling_add_slashes_before_saving_content';
+ public const string SETTING_ADD_SLASHES_BEFORE_SAVING_CONTENT_DEFAULT = "1";
public static function isAddSlashesBeforeSavingPostContent(): bool
{
@@ -239,8 +239,8 @@ public static function setAddSlashesBeforeSavingContent(string $value): void
}
}
- public const SETTING_ADD_SLASHES_BEFORE_SAVING_META = 'smartling_add_slashes_before_saving_meta';
- public const SETTING_ADD_SLASHES_BEFORE_SAVING_META_DEFAULT = "1";
+ public const string SETTING_ADD_SLASHES_BEFORE_SAVING_META = 'smartling_add_slashes_before_saving_meta';
+ public const string SETTING_ADD_SLASHES_BEFORE_SAVING_META_DEFAULT = "1";
public static function isAddSlashesBeforeSavingPostMeta(): bool
{
@@ -256,8 +256,8 @@ public static function setAddSlashesBeforeSavingMeta(string $value): void
}
}
- public const SETTING_CUSTOM_DIRECTIVES = 'smartling_custom_directives';
- public const SETTING_CUSTOM_DIRECTIVES_DEFAULT = '';
+ public const string SETTING_CUSTOM_DIRECTIVES = 'smartling_custom_directives';
+ public const string SETTING_CUSTOM_DIRECTIVES_DEFAULT = '';
public static function getCustomDirectives(): string
{
diff --git a/inc/Smartling/Services/InvalidCharacterCleaner.php b/inc/Smartling/Services/InvalidCharacterCleaner.php
index d7e89012..344e4d81 100644
--- a/inc/Smartling/Services/InvalidCharacterCleaner.php
+++ b/inc/Smartling/Services/InvalidCharacterCleaner.php
@@ -8,7 +8,7 @@
class InvalidCharacterCleaner implements WPHookInterface
{
- private const ILLEGAL_CHAR_REGEXP = '#[^\x{0009}\x{000A}\x{000D}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+#us';
+ private const string ILLEGAL_CHAR_REGEXP = '#[^\x{0009}\x{000A}\x{000D}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+#us';
/**
* Registers wp hook handlers. Invoked by wordpress.
diff --git a/inc/Smartling/Settings/ConfigurationProfileEntity.php b/inc/Smartling/Settings/ConfigurationProfileEntity.php
index 72e4a704..c9a1e63a 100644
--- a/inc/Smartling/Settings/ConfigurationProfileEntity.php
+++ b/inc/Smartling/Settings/ConfigurationProfileEntity.php
@@ -11,23 +11,23 @@
*/
class ConfigurationProfileEntity extends SmartlingEntityAbstract
{
- private const REGEX_PROJECT_ID = '([0-9a-f]){9}';
+ private const string REGEX_PROJECT_ID = '([0-9a-f]){9}';
- public const RETRIEVAL_TYPE_PSEUDO = 'pseudo';
- public const RETRIEVAL_TYPE_PUBLISHED = 'published';
+ public const string RETRIEVAL_TYPE_PSEUDO = 'pseudo';
+ public const string RETRIEVAL_TYPE_PUBLISHED = 'published';
- public const UPLOAD_ON_CHANGE_MANUAL = 0;
+ public const int UPLOAD_ON_CHANGE_MANUAL = 0;
- public const UPLOAD_ON_CHANGE_AUTO = 1;
+ public const int UPLOAD_ON_CHANGE_AUTO = 1;
- public const TRANSLATION_DOWNLOAD_MODE_TRANSLATION_COMPLETED = 0;
- public const TRANSLATION_DOWNLOAD_MODE_PROGRESS_CHANGES = 1;
- public const TRANSLATION_DOWNLOAD_MODE_MANUAL = 2;
+ public const int TRANSLATION_DOWNLOAD_MODE_TRANSLATION_COMPLETED = 0;
+ public const int TRANSLATION_DOWNLOAD_MODE_PROGRESS_CHANGES = 1;
+ public const int TRANSLATION_DOWNLOAD_MODE_MANUAL = 2;
- public const TRANSLATION_PUBLISHING_MODE_NO_CHANGE = 0;
- public const TRANSLATION_PUBLISHING_MODE_PUBLISH = 1;
- public const TRANSLATION_PUBLISHING_MODE_DRAFT = 2;
+ public const int TRANSLATION_PUBLISHING_MODE_NO_CHANGE = 0;
+ public const int TRANSLATION_PUBLISHING_MODE_PUBLISH = 1;
+ public const int TRANSLATION_PUBLISHING_MODE_DRAFT = 2;
protected static function getInstance(): ConfigurationProfileEntity
{
@@ -171,7 +171,7 @@ public function getSecretKey(): string
return (string)$this->stateFields['secret_key'];
}
- public function setSecretKey(string $secret_key): void
+ public function setSecretKey(#[\SensitiveParameter] string $secret_key): void
{
$this->stateFields['secret_key'] = $secret_key;
}
diff --git a/inc/Smartling/Submissions/SubmissionEntity.php b/inc/Smartling/Submissions/SubmissionEntity.php
index 7f496da0..f0b043c4 100644
--- a/inc/Smartling/Submissions/SubmissionEntity.php
+++ b/inc/Smartling/Submissions/SubmissionEntity.php
@@ -37,17 +37,17 @@
*/
class SubmissionEntity extends SmartlingEntityAbstract implements Submission
{
- public const FLAG_CONTENT_IS_OUT_OF_DATE = 1;
+ public const int FLAG_CONTENT_IS_OUT_OF_DATE = 1;
- public const FLAG_CONTENT_IS_UP_TO_DATE = 0;
+ public const int FLAG_CONTENT_IS_UP_TO_DATE = 0;
- public const DATETIME_FORMAT = 'Y-m-d H:i:s';
+ public const string DATETIME_FORMAT = 'Y-m-d H:i:s';
- public const SUBMISSION_STATUS_NEW = 'New';
- public const SUBMISSION_STATUS_IN_PROGRESS = 'In Progress';
- public const SUBMISSION_STATUS_COMPLETED = 'Completed';
- public const SUBMISSION_STATUS_FAILED = 'Failed';
- public const SUBMISSION_STATUS_CANCELLED = 'Cancelled';
+ public const string SUBMISSION_STATUS_NEW = 'New';
+ public const string SUBMISSION_STATUS_IN_PROGRESS = 'In Progress';
+ public const string SUBMISSION_STATUS_COMPLETED = 'Completed';
+ public const string SUBMISSION_STATUS_FAILED = 'Failed';
+ public const string SUBMISSION_STATUS_CANCELLED = 'Cancelled';
public static array $submissionStatuses = [
self::SUBMISSION_STATUS_NEW,
@@ -57,34 +57,34 @@ class SubmissionEntity extends SmartlingEntityAbstract implements Submission
self::SUBMISSION_STATUS_CANCELLED,
];
- public const FIELD_ID = 'id';
- public const FIELD_SOURCE_TITLE = 'source_title';
- public const FIELD_SOURCE_BLOG_ID = 'source_blog_id';
- public const FIELD_SOURCE_CONTENT_HASH = 'source_content_hash';
- public const FIELD_CONTENT_TYPE = 'content_type';
- public const FIELD_SOURCE_ID = 'source_id';
- public const FIELD_FILE_URI = 'file_uri';
- public const FIELD_TARGET_LOCALE = 'target_locale';
- public const FIELD_TARGET_BLOG_ID = 'target_blog_id';
- public const FIELD_TARGET_ID = 'target_id';
- public const FIELD_SUBMITTER = 'submitter';
- public const FIELD_SUBMISSION_DATE = 'submission_date';
- public const FIELD_APPLIED_DATE = 'applied_date';
- public const FIELD_APPROVED_STRING_COUNT = 'approved_string_count';
- public const FIELD_COMPLETED_STRING_COUNT = 'completed_string_count';
- public const FIELD_EXCLUDED_STRING_COUNT = 'excluded_string_count';
- public const FIELD_TOTAL_STRING_COUNT = 'total_string_count';
- public const FIELD_WORD_COUNT = 'word_count';
- public const FIELD_STATUS = 'status';
- public const FIELD_IS_LOCKED = 'is_locked';
- public const FIELD_IS_CLONED = 'is_cloned';
- public const FIELD_LAST_MODIFIED = 'last_modified';
- public const FIELD_OUTDATED = 'outdated';
- public const FIELD_LAST_ERROR = 'last_error';
- public const FIELD_LOCKED_FIELDS = 'locked_fields';
- public const FIELD_CREATED_AT = 'created_at';
-
- public const VIRTUAL_FIELD_JOB_LINK = 'job_link';
+ public const string FIELD_ID = 'id';
+ public const string FIELD_SOURCE_TITLE = 'source_title';
+ public const string FIELD_SOURCE_BLOG_ID = 'source_blog_id';
+ public const string FIELD_SOURCE_CONTENT_HASH = 'source_content_hash';
+ public const string FIELD_CONTENT_TYPE = 'content_type';
+ public const string FIELD_SOURCE_ID = 'source_id';
+ public const string FIELD_FILE_URI = 'file_uri';
+ public const string FIELD_TARGET_LOCALE = 'target_locale';
+ public const string FIELD_TARGET_BLOG_ID = 'target_blog_id';
+ public const string FIELD_TARGET_ID = 'target_id';
+ public const string FIELD_SUBMITTER = 'submitter';
+ public const string FIELD_SUBMISSION_DATE = 'submission_date';
+ public const string FIELD_APPLIED_DATE = 'applied_date';
+ public const string FIELD_APPROVED_STRING_COUNT = 'approved_string_count';
+ public const string FIELD_COMPLETED_STRING_COUNT = 'completed_string_count';
+ public const string FIELD_EXCLUDED_STRING_COUNT = 'excluded_string_count';
+ public const string FIELD_TOTAL_STRING_COUNT = 'total_string_count';
+ public const string FIELD_WORD_COUNT = 'word_count';
+ public const string FIELD_STATUS = 'status';
+ public const string FIELD_IS_LOCKED = 'is_locked';
+ public const string FIELD_IS_CLONED = 'is_cloned';
+ public const string FIELD_LAST_MODIFIED = 'last_modified';
+ public const string FIELD_OUTDATED = 'outdated';
+ public const string FIELD_LAST_ERROR = 'last_error';
+ public const string FIELD_LOCKED_FIELDS = 'locked_fields';
+ public const string FIELD_CREATED_AT = 'created_at';
+
+ public const string VIRTUAL_FIELD_JOB_LINK = 'job_link';
private ?JobEntity $jobInformation = null;
diff --git a/inc/Smartling/Tuner/FilterManager.php b/inc/Smartling/Tuner/FilterManager.php
index 1b6393cb..77bd6784 100644
--- a/inc/Smartling/Tuner/FilterManager.php
+++ b/inc/Smartling/Tuner/FilterManager.php
@@ -6,7 +6,7 @@
class FilterManager extends CustomizationManagerAbstract implements WPHookInterface
{
- private const STORAGE_KEY = 'CUSTOM_FILTERS';
+ private const string STORAGE_KEY = 'CUSTOM_FILTERS';
public function __construct()
{
diff --git a/inc/Smartling/Tuner/MediaAttachmentRulesManager.php b/inc/Smartling/Tuner/MediaAttachmentRulesManager.php
index b5a8cbb0..9a0af53b 100644
--- a/inc/Smartling/Tuner/MediaAttachmentRulesManager.php
+++ b/inc/Smartling/Tuner/MediaAttachmentRulesManager.php
@@ -10,7 +10,7 @@ class MediaAttachmentRulesManager extends CustomizationManagerAbstract
{
use LoggerSafeTrait;
- private const STORAGE_KEY = 'CUSTOM_MEDIA_RULES';
+ private const string STORAGE_KEY = 'CUSTOM_MEDIA_RULES';
private array $preconfiguredRules;
private array $temporaryRules = [];
diff --git a/inc/Smartling/Tuner/ShortcodeManager.php b/inc/Smartling/Tuner/ShortcodeManager.php
index ada577f7..6843b6d8 100644
--- a/inc/Smartling/Tuner/ShortcodeManager.php
+++ b/inc/Smartling/Tuner/ShortcodeManager.php
@@ -6,7 +6,7 @@
class ShortcodeManager extends CustomizationManagerAbstract implements WPHookInterface
{
- private const STORAGE_KEY = 'CUSTOM_SHORTCODES';
+ private const string STORAGE_KEY = 'CUSTOM_SHORTCODES';
public function __construct()
{
diff --git a/inc/Smartling/WP/Controller/AdminPage.php b/inc/Smartling/WP/Controller/AdminPage.php
index 38a464e1..04daf5bb 100644
--- a/inc/Smartling/WP/Controller/AdminPage.php
+++ b/inc/Smartling/WP/Controller/AdminPage.php
@@ -16,9 +16,9 @@
class AdminPage extends ControllerAbstract implements WPHookInterface
{
- public const SLUG = 'smartling_customization_tuning';
- public const ACTION_EXPORT_GUTENBERG_RULES = 'smartling_export_gutenberg_rules';
- public const ACTION_IMPORT_GUTENBERG_RULES = 'smartling_import_gutenberg_rules';
+ public const string SLUG = 'smartling_customization_tuning';
+ public const string ACTION_EXPORT_GUTENBERG_RULES = 'smartling_export_gutenberg_rules';
+ public const string ACTION_IMPORT_GUTENBERG_RULES = 'smartling_import_gutenberg_rules';
private MediaAttachmentRulesManager $mediaAttachmentRulesManager;
private ReplacerFactory $replacerFactory;
diff --git a/inc/Smartling/WP/Controller/CheckStatusController.php b/inc/Smartling/WP/Controller/CheckStatusController.php
index 3afd64be..215fd242 100644
--- a/inc/Smartling/WP/Controller/CheckStatusController.php
+++ b/inc/Smartling/WP/Controller/CheckStatusController.php
@@ -17,9 +17,9 @@
*/
class CheckStatusController extends WPAbstract implements WPHookInterface
{
- const SUBMISSION_CHECKED_KEY = "smartling-page-checked-items";
- const CACHE_SLIDE_EXPIRATION = "PT1H";
- const CACHE_EXPIRATION = 7200;
+ const string SUBMISSION_CHECKED_KEY = "smartling-page-checked-items";
+ const string CACHE_SLIDE_EXPIRATION = "PT1H";
+ const int CACHE_EXPIRATION = 7200;
public function wp_enqueue()
{
@@ -107,4 +107,4 @@ public function checkItems(array $items)
return $result;
}
-}
\ No newline at end of file
+}
diff --git a/inc/Smartling/WP/Controller/ConfigurationProfileFormController.php b/inc/Smartling/WP/Controller/ConfigurationProfileFormController.php
index d7e3440e..586064a6 100644
--- a/inc/Smartling/WP/Controller/ConfigurationProfileFormController.php
+++ b/inc/Smartling/WP/Controller/ConfigurationProfileFormController.php
@@ -14,8 +14,8 @@
class ConfigurationProfileFormController extends WPAbstract implements WPHookInterface
{
- public const FILTER_FIELD_NAME_REGEXP = 'filter_field_name_regexp';
- public const ERROR_TARGET_LOCALES = 'tl';
+ public const string FILTER_FIELD_NAME_REGEXP = 'filter_field_name_regexp';
+ public const string ERROR_TARGET_LOCALES = 'tl';
public function wp_enqueue(): void
{
diff --git a/inc/Smartling/WP/Controller/ConfigurationProfilesController.php b/inc/Smartling/WP/Controller/ConfigurationProfilesController.php
index b5fdeb93..57612e6d 100644
--- a/inc/Smartling/WP/Controller/ConfigurationProfilesController.php
+++ b/inc/Smartling/WP/Controller/ConfigurationProfilesController.php
@@ -22,10 +22,10 @@
class ConfigurationProfilesController extends WPAbstract implements WPHookInterface
{
- public const ACTION_QUEUE_PURGE = 'queue_purge';
- public const ACTION_QUEUE_FORCE = 'queue_force';
+ public const string ACTION_QUEUE_PURGE = 'queue_purge';
+ public const string ACTION_QUEUE_FORCE = 'queue_force';
- public const MENU_SLUG = 'smartling_configuration_profile_list';
+ public const string MENU_SLUG = 'smartling_configuration_profile_list';
public function __construct(
LocalizationPluginProxyInterface $connector,
diff --git a/inc/Smartling/WP/Controller/ContentEditJobController.php b/inc/Smartling/WP/Controller/ContentEditJobController.php
index 48a09843..189a8453 100644
--- a/inc/Smartling/WP/Controller/ContentEditJobController.php
+++ b/inc/Smartling/WP/Controller/ContentEditJobController.php
@@ -17,7 +17,7 @@
class ContentEditJobController extends WPAbstract implements WPHookInterface
{
- public const SMARTLING_JOB_API_PROXY = 'smartling_job_api_proxy';
+ public const string SMARTLING_JOB_API_PROXY = 'smartling_job_api_proxy';
/**
* @var string
*/
@@ -278,4 +278,4 @@ public function box($attr)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/inc/Smartling/WP/Controller/DuplicateSubmissionsCleaner.php b/inc/Smartling/WP/Controller/DuplicateSubmissionsCleaner.php
index 14ae269a..3f6f6498 100644
--- a/inc/Smartling/WP/Controller/DuplicateSubmissionsCleaner.php
+++ b/inc/Smartling/WP/Controller/DuplicateSubmissionsCleaner.php
@@ -12,10 +12,10 @@
use Smartling\WP\WPHookInterface;
class DuplicateSubmissionsCleaner extends ControllerAbstract implements WPHookInterface {
- public const SLUG = 'smartling_duplicate_submission_cleaner';
+ public const string SLUG = 'smartling_duplicate_submission_cleaner';
- private const CACHE_KEY = 'submissions-has-duplicate';
- private const NONCE_ACTION = "duplicate-submission-cleaner";
+ private const string CACHE_KEY = 'submissions-has-duplicate';
+ private const string NONCE_ACTION = "duplicate-submission-cleaner";
public function __construct(
private Cache $cache,
@@ -60,10 +60,10 @@ private function processAction(): void
$submission = $this->submissionManager->getEntityById((int)$_REQUEST['id']);
if ($submission !== null) {
foreach ($this->getDuplicatesAndCache(false) as $details) {
- if ($details->getContentType() === $submission->getContentType() &&
- $details->getSourceBlogId() === $submission->getSourceBlogId() &&
- $details->getSourceId() === $submission->getSourceId() &&
- $details->getTargetBlogId() === $submission->getTargetBlogId()
+ if ($details->contentType === $submission->getContentType() &&
+ $details->sourceBlogId === $submission->getSourceBlogId() &&
+ $details->sourceId === $submission->getSourceId() &&
+ $details->targetBlogId === $submission->getTargetBlogId()
) {
$this->submissionManager->delete($submission);
break;
diff --git a/inc/Smartling/WP/Controller/FilterForm.php b/inc/Smartling/WP/Controller/FilterForm.php
index 5f985fa9..35845143 100644
--- a/inc/Smartling/WP/Controller/FilterForm.php
+++ b/inc/Smartling/WP/Controller/FilterForm.php
@@ -8,8 +8,8 @@
class FilterForm extends ControllerAbstract implements WPHookInterface
{
- public const SLUG = AdminPage::SLUG . '_filter_form';
- public const ACTION_SAVE = self::SLUG . '_save';
+ public const string SLUG = AdminPage::SLUG . '_filter_form';
+ public const string ACTION_SAVE = self::SLUG . '_save';
public function register(): void
{
diff --git a/inc/Smartling/WP/Controller/LiveNotificationController.php b/inc/Smartling/WP/Controller/LiveNotificationController.php
index 87eda7d6..5a460dc6 100644
--- a/inc/Smartling/WP/Controller/LiveNotificationController.php
+++ b/inc/Smartling/WP/Controller/LiveNotificationController.php
@@ -17,20 +17,20 @@ class LiveNotificationController implements WPHookInterface
{
use LoggerSafeTrait;
- private const DELETE_NOTIFICATION_ACTION_NAME = 'smartling_delete_live_notification';
+ private const string DELETE_NOTIFICATION_ACTION_NAME = 'smartling_delete_live_notification';
- private const FIREBASE_SPACE_ID = 'wordpress-connector';
- private const FIREBASE_OBJECT_ID = 'notifications';
+ private const string FIREBASE_SPACE_ID = 'wordpress-connector';
+ private const string FIREBASE_OBJECT_ID = 'notifications';
- private const CONFIG_CACHE_KEY = 'progress_tracker_config_cache_key';
- private const CONFIG_CACHE_TIME_SEC = 3600;
+ private const string CONFIG_CACHE_KEY = 'progress_tracker_config_cache_key';
+ private const int CONFIG_CACHE_TIME_SEC = 3600;
- private const UI_NOTIFICATION_IDENTIFIER_CLASS = 'smartling-notification-wrapper';
- private const UI_NOTIFICATION_IDENTIFIER_CLASS_GENERAL = 'smartling-notification-wrapper-general';
+ private const string UI_NOTIFICATION_IDENTIFIER_CLASS = 'smartling-notification-wrapper';
+ private const string UI_NOTIFICATION_IDENTIFIER_CLASS_GENERAL = 'smartling-notification-wrapper-general';
- public const SEVERITY_WARNING = 'notification-warning';
- public const SEVERITY_SUCCESS = 'notification-success';
- public const SEVERITY_ERROR = 'notification-error';
+ public const string SEVERITY_WARNING = 'notification-warning';
+ public const string SEVERITY_SUCCESS = 'notification-success';
+ public const string SEVERITY_ERROR = 'notification-error';
private ApiWrapperInterface $apiWrapper;
private SettingsManager $settingsManager;
@@ -237,13 +237,13 @@ public function pushNotificationHandler(NotificationParameters $params): void
{
try {
$this->apiWrapper->setNotificationRecord(
- $this->settingsManager->getActiveProfileByProjectId($params->getProjectId()),
+ $this->settingsManager->getActiveProfileByProjectId($params->projectId),
static::FIREBASE_SPACE_ID,
static::FIREBASE_OBJECT_ID,
- $params->getContentId(),
+ $params->contentId,
[
- 'message' => $params->getMessage(),
- 'severity' => $params->getSeverity(),
+ 'message' => $params->message,
+ 'severity' => $params->severity,
]
);
} catch (\Exception $e) {
diff --git a/inc/Smartling/WP/Controller/MediaRuleForm.php b/inc/Smartling/WP/Controller/MediaRuleForm.php
index 16ab9731..0ae54995 100644
--- a/inc/Smartling/WP/Controller/MediaRuleForm.php
+++ b/inc/Smartling/WP/Controller/MediaRuleForm.php
@@ -10,8 +10,8 @@
class MediaRuleForm extends ControllerAbstract implements WPHookInterface
{
- public const SLUG = AdminPage::SLUG . '_media_form';
- public const ACTION_SAVE = self::SLUG . '_save';
+ public const string SLUG = AdminPage::SLUG . '_media_form';
+ public const string ACTION_SAVE = self::SLUG . '_save';
protected MediaAttachmentRulesManager $mediaAttachmentRulesManager;
protected ReplacerFactory $replacerFactory;
diff --git a/inc/Smartling/WP/Controller/PostBasedWidgetControllerStd.php b/inc/Smartling/WP/Controller/PostBasedWidgetControllerStd.php
index a854d8b0..0b37409b 100644
--- a/inc/Smartling/WP/Controller/PostBasedWidgetControllerStd.php
+++ b/inc/Smartling/WP/Controller/PostBasedWidgetControllerStd.php
@@ -29,36 +29,36 @@ class PostBasedWidgetControllerStd extends WPAbstract implements WPHookInterface
{
use DetectContentChangeTrait;
- private const WIDGET_NAME = 'smartling_connector_widget';
- public const WIDGET_DATA_NAME = 'smartling';
- private const CONNECTOR_NONCE = 'smartling_connector_nonce';
+ private const string WIDGET_NAME = 'smartling_connector_widget';
+ public const string WIDGET_DATA_NAME = 'smartling';
+ private const string CONNECTOR_NONCE = 'smartling_connector_nonce';
protected string $servedContentType = 'undefined';
protected string $needSave = 'Need to have title';
protected string $noOriginalFound = 'No original post found';
protected string $abilityNeeded = 'edit_post';
- private const RESPONSE_AJAX_STATUS_FAIL = 'FAIL';
- private const RESPONSE_AJAX_STATUS_SUCCESS = 'SUCCESS';
+ private const string RESPONSE_AJAX_STATUS_FAIL = 'FAIL';
+ private const string RESPONSE_AJAX_STATUS_SUCCESS = 'SUCCESS';
- private const ERROR_KEY_FIELD_MISSING = 'field.missing';
- private const ERROR_MSG_FIELD_MISSING = 'Required field \'%s\' is missing.';
+ private const string ERROR_KEY_FIELD_MISSING = 'field.missing';
+ private const string ERROR_MSG_FIELD_MISSING = 'Required field \'%s\' is missing.';
- private const ERROR_KEY_NO_PROFILE_FOUND = 'profile.not.found';
- private const ERROR_MSG_NO_PROFILE_FOUND = 'No suitable configuration profile found.';
+ private const string ERROR_KEY_NO_PROFILE_FOUND = 'profile.not.found';
+ private const string ERROR_MSG_NO_PROFILE_FOUND = 'No suitable configuration profile found.';
- private const ERROR_KEY_TARGET_BLOG_EMPTY = 'no.target';
- private const ERROR_MSG_TARGET_BLOG_EMPTY = 'No target blog selected.';
+ private const string ERROR_KEY_TARGET_BLOG_EMPTY = 'no.target';
+ private const string ERROR_MSG_TARGET_BLOG_EMPTY = 'No target blog selected.';
- private const ERROR_KEY_NO_CONTENT = 'no.content';
- private const ERROR_MSG_NO_CONTENT = 'No source content selected.';
+ private const string ERROR_KEY_NO_CONTENT = 'no.content';
+ private const string ERROR_MSG_NO_CONTENT = 'No source content selected.';
- private const ERROR_KEY_INVALID_BLOG = 'invalid.blog';
- private const ERROR_MSG_INVALID_BLOG = 'Invalid blog value.';
+ private const string ERROR_KEY_INVALID_BLOG = 'invalid.blog';
+ private const string ERROR_MSG_INVALID_BLOG = 'Invalid blog value.';
- private const ERROR_KEY_TYPE_MISSING = 'content.type.missing';
- private const ERROR_MSG_TYPE_MISSING = 'Source content-type missing.';
+ private const string ERROR_KEY_TYPE_MISSING = 'content.type.missing';
+ private const string ERROR_MSG_TYPE_MISSING = 'Source content-type missing.';
private array $mutedTypes = [
'attachment',
diff --git a/inc/Smartling/WP/Controller/ShortcodeForm.php b/inc/Smartling/WP/Controller/ShortcodeForm.php
index 2202a61c..c3c50126 100644
--- a/inc/Smartling/WP/Controller/ShortcodeForm.php
+++ b/inc/Smartling/WP/Controller/ShortcodeForm.php
@@ -8,8 +8,8 @@
class ShortcodeForm extends ControllerAbstract implements WPHookInterface
{
- public const SLUG = AdminPage::SLUG . '_shortcode_form';
- public const ACTION_SAVE = self::SLUG . '_save';
+ public const string SLUG = AdminPage::SLUG . '_shortcode_form';
+ public const string ACTION_SAVE = self::SLUG . '_save';
public function register(): void
{
diff --git a/inc/Smartling/WP/Controller/TaxonomyWidgetController.php b/inc/Smartling/WP/Controller/TaxonomyWidgetController.php
index d4dcf799..18ca5601 100644
--- a/inc/Smartling/WP/Controller/TaxonomyWidgetController.php
+++ b/inc/Smartling/WP/Controller/TaxonomyWidgetController.php
@@ -18,7 +18,7 @@
class TaxonomyWidgetController extends WPAbstract implements WPHookInterface
{
- public const WIDGET_DATA_NAME = 'smartling';
+ public const string WIDGET_DATA_NAME = 'smartling';
use CommonLogMessagesTrait;
use DetectContentChangeTrait;
diff --git a/inc/Smartling/WP/Controller/TestRunController.php b/inc/Smartling/WP/Controller/TestRunController.php
index 1c04224b..beb0068e 100644
--- a/inc/Smartling/WP/Controller/TestRunController.php
+++ b/inc/Smartling/WP/Controller/TestRunController.php
@@ -33,10 +33,10 @@
class TestRunController extends WPAbstract implements WPHookInterface
{
- private const TEST_RUN_JOB_NAME = 'Test Run Job';
+ private const string TEST_RUN_JOB_NAME = 'Test Run Job';
- public const ACTION_CLEAR_FLAG = 'clear_flag';
- public const SLUG = 'smartling_test_run';
+ public const string ACTION_CLEAR_FLAG = 'clear_flag';
+ public const string SLUG = 'smartling_test_run';
private ContentRelationsDiscoveryService $contentRelationDiscoveryService;
private ApiWrapperInterface $apiWrapper;
@@ -135,7 +135,7 @@ public function widget(): void
SimpleStorageHelper::drop(TestRunHelper::TEST_RUN_BLOG_ID_SETTING_NAME);
}
$viewData = $this->buildViewData();
- if ($viewData->getNew() + $viewData->getInProgress() + $viewData->getCompleted() + $viewData->getFailed() === 0) {
+ if ($viewData->new + $viewData->inProgress + $viewData->completed + $viewData->failed === 0) {
$this->getLogger()->notice('A blog was selected for test run, but no entries uploaded, clearing test run blog');
SimpleStorageHelper::drop(TestRunHelper::TEST_RUN_BLOG_ID_SETTING_NAME);
$viewData = $this->buildViewData();
diff --git a/inc/Smartling/WP/Table/BulkSubmitTableWidget.php b/inc/Smartling/WP/Table/BulkSubmitTableWidget.php
index 1a17273d..5827f077 100644
--- a/inc/Smartling/WP/Table/BulkSubmitTableWidget.php
+++ b/inc/Smartling/WP/Table/BulkSubmitTableWidget.php
@@ -33,17 +33,17 @@ class BulkSubmitTableWidget extends SmartlingListTable
use CommonLogMessagesTrait;
use LoggerSafeTrait;
- private const CUSTOM_CONTROLS_NAMESPACE = 'smartling-bulk-submit-page';
+ private const string CUSTOM_CONTROLS_NAMESPACE = 'smartling-bulk-submit-page';
/**
* base name of Content-type filtering select
*/
- private const CONTENT_TYPE_SELECT_ELEMENT_NAME = 'content-type';
- private const SUBMISSION_STATUS_SELECT_ELEMENT_NAME = 'submission-status';
+ private const string CONTENT_TYPE_SELECT_ELEMENT_NAME = 'content-type';
+ private const string SUBMISSION_STATUS_SELECT_ELEMENT_NAME = 'submission-status';
/**
* base name of title search textbox
*/
- private const TITLE_SEARCH_TEXTBOX_ELEMENT_NAME = 'title-search';
+ private const string TITLE_SEARCH_TEXTBOX_ELEMENT_NAME = 'title-search';
private array $defaultValues = [
self::CONTENT_TYPE_SELECT_ELEMENT_NAME => 'post',
diff --git a/inc/Smartling/WP/Table/DuplicateSubmissions.php b/inc/Smartling/WP/Table/DuplicateSubmissions.php
index 1659e1cc..6feb601b 100644
--- a/inc/Smartling/WP/Table/DuplicateSubmissions.php
+++ b/inc/Smartling/WP/Table/DuplicateSubmissions.php
@@ -62,27 +62,33 @@ public function prepare_items(): void
{
$data = [];
$this->_column_headers = [$this->get_columns(), [], []];
- $contentType = $this->duplicateSubmissionDetails->getContentType();
- $sourceId = $this->duplicateSubmissionDetails->getSourceId();
+ $duplicateSubmissionDetails = $this->duplicateSubmissionDetails;
+ $contentType = $duplicateSubmissionDetails->contentType;
+ $duplicateSubmissionDetails1 = $this->duplicateSubmissionDetails;
+ $sourceId = $duplicateSubmissionDetails1->sourceId;
+ $duplicateSubmissionDetails2 = $this->duplicateSubmissionDetails;
$data[] = $this->siteHelper->withBlog(
- $this->duplicateSubmissionDetails->getTargetBlogId(),
+ $duplicateSubmissionDetails2->targetBlogId,
function () use ($contentType, $sourceId) {
$data = [];
+ $duplicateSubmissionDetails1 = $this->duplicateSubmissionDetails;
+ $duplicateSubmissionDetails2 = $this->duplicateSubmissionDetails;
foreach (
$this->submissionManager->find([
SubmissionEntity::FIELD_CONTENT_TYPE => $contentType,
- SubmissionEntity::FIELD_SOURCE_BLOG_ID => $this->duplicateSubmissionDetails->getSourceBlogId(),
+ SubmissionEntity::FIELD_SOURCE_BLOG_ID => $duplicateSubmissionDetails1->sourceBlogId,
SubmissionEntity::FIELD_SOURCE_ID => $sourceId,
- SubmissionEntity::FIELD_TARGET_BLOG_ID => $this->duplicateSubmissionDetails->getTargetBlogId(),
+ SubmissionEntity::FIELD_TARGET_BLOG_ID => $duplicateSubmissionDetails2->targetBlogId,
]) as $target
) {
$editLink = $this->getEditLink($contentType, $target->getTargetId());
+ $duplicateSubmissionDetails = $this->duplicateSubmissionDetails;
$data[] = [
'targetId' => $target->getTargetId(),
'targetEdit' => $editLink === null ? '' : "Edit",
'action' => 'getId()}&_wpnonce={$this->nonce}" . '">Delete'
),
diff --git a/inc/Smartling/WP/Table/SubmissionTableWidget.php b/inc/Smartling/WP/Table/SubmissionTableWidget.php
index 13cb87fd..f461fae7 100644
--- a/inc/Smartling/WP/Table/SubmissionTableWidget.php
+++ b/inc/Smartling/WP/Table/SubmissionTableWidget.php
@@ -31,26 +31,26 @@ class SubmissionTableWidget extends SmartlingListTable
use CommonLogMessagesTrait;
use LoggerSafeTrait;
- private const ACTION_CHECK_STATUS = 'checkStatus';
- public const ACTION_DOWNLOAD = 'download';
- private const ACTION_LOCK = 'lock';
- private const ACTION_UNLOCK = 'unlock';
- private const ACTION_UPLOAD = 'upload';
+ private const string ACTION_CHECK_STATUS = 'checkStatus';
+ public const string ACTION_DOWNLOAD = 'download';
+ private const string ACTION_LOCK = 'lock';
+ private const string ACTION_UNLOCK = 'unlock';
+ private const string ACTION_UPLOAD = 'upload';
/**
* base name of Content-type filtering select
*/
- private const CONTENT_TYPE_SELECT_ELEMENT_NAME = 'content-type';
+ private const string CONTENT_TYPE_SELECT_ELEMENT_NAME = 'content-type';
/**
* base name of status filtering select
*/
- private const SUBMISSION_STATUS_SELECT_ELEMENT_NAME = 'status';
+ private const string SUBMISSION_STATUS_SELECT_ELEMENT_NAME = 'status';
- private const SUBMISSION_OUTDATED_STATE = 'state_outdated';
- private const SUBMISSION_LOCKED_STATE = 'state_locked';
- private const SUBMISSION_CLONED_STATE = 'state_cloned';
- private const SUBMISSION_TARGET_LOCALE = 'target-locale';
+ private const string SUBMISSION_OUTDATED_STATE = 'state_outdated';
+ private const string SUBMISSION_LOCKED_STATE = 'state_locked';
+ private const string SUBMISSION_CLONED_STATE = 'state_cloned';
+ private const string SUBMISSION_TARGET_LOCALE = 'target-locale';
private string $_custom_controls_namespace = 'smartling-submissions-page';
diff --git a/inc/Smartling/WP/View/DuplicateSubmissionsCleaner.php b/inc/Smartling/WP/View/DuplicateSubmissionsCleaner.php
index 4d986f89..86330cc4 100644
--- a/inc/Smartling/WP/View/DuplicateSubmissionsCleaner.php
+++ b/inc/Smartling/WP/View/DuplicateSubmissionsCleaner.php
@@ -15,16 +15,16 @@
foreach ($duplicates as $set) {
assert($set instanceof DuplicateSubmissions);
$details = $set->getDuplicateSubmissionDetails();
- $editLink = $set->getEditLink($details->getContentType(), $details->getSourceId());
+ $editLink = $set->getEditLink($details->contentType, $details->sourceId);
echo '";
+ echo " in target blog {$details->targetBlogId}";
$set->prepare_items();
$set->display();
}
diff --git a/inc/Smartling/WP/View/TestRun.php b/inc/Smartling/WP/View/TestRun.php
index b8ea2d33..ebc5ac1d 100644
--- a/inc/Smartling/WP/View/TestRun.php
+++ b/inc/Smartling/WP/View/TestRun.php
@@ -14,10 +14,10 @@
Test run
Send all posts and pages and their related content one level deep for pseudo translation, and check the result for known issues. After a test run completes you should check it too, to see any issues that were not detected. Expected result after a test run is that all text and media content gets translated.
getTestBlogId() === null && count($viewData->getBlogs()) === 0) {
+if ($viewData->testBlogId === null && count($viewData->blogs) === 0) {
echo 'You need to either add a new site or completely remove submissions from an existing one to start a test run.
';
}
-if ($viewData->getTestBlogId() === null) {
+if ($viewData->testBlogId === null) {
?>
', get_admin_url(null, 'admin.php?page=' . $this::SLUG), $this::ACTION_CLEAR_FLAG);
}
} else {
diff --git a/readme.txt b/readme.txt
index 665d2816..d69a14c3 100755
--- a/readme.txt
+++ b/readme.txt
@@ -3,8 +3,8 @@ Contributors: smartling
Tags: translation, localization, localisation, translate, multilingual, smartling, internationalization, internationalisation, automation, international
Requires at least: 5.5
Tested up to: 6.6.2
-Requires PHP: 8.0
-Stable tag: 3.10.0
+Requires PHP: 8.3
+Stable tag: 4.0.0
License: GPLv2 or later
Translate content in WordPress quickly and seamlessly with Smartling, the industry-leading Translation Management System.
@@ -62,6 +62,9 @@ Additional information on the Smartling Connector for WordPress can be found [he
3. Track translation status within WordPress from the Submissions Board. View overall progress of submitted translation requests as well as resend updated content.
== Changelog ==
+= 4.0.0 =
+* Minimum required PHP version is now 8.3!
+
= 3.10.0 =
* Remove a cloned status when the user requests translation of the previously cloned submission
diff --git a/smartling-connector.php b/smartling-connector.php
index 2b71daf7..52fc8d6f 100755
--- a/smartling-connector.php
+++ b/smartling-connector.php
@@ -11,7 +11,7 @@
* Plugin Name: Smartling Connector
* Plugin URI: https://www.smartling.com/products/automate/integrations/wordpress/
* Description: Integrate your WordPress site with Smartling to upload your content and download translations.
- * Version: 3.10.0
+ * Version: 4.0.0
* Author: Smartling
* Author URI: https://www.smartling.com
* License: GPL-2.0+
@@ -19,7 +19,7 @@
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: smartling-connector
* Domain Path: /languages
- * Requires PHP: 8.0
+ * Requires PHP: 8.3
* Elementor tested up to: 3.20.2
*/
diff --git a/tests/IntegrationTests/tests/SubmissionUploadTest.php b/tests/IntegrationTests/tests/SubmissionUploadTest.php
index 5aa83e85..c5ddfa9b 100644
--- a/tests/IntegrationTests/tests/SubmissionUploadTest.php
+++ b/tests/IntegrationTests/tests/SubmissionUploadTest.php
@@ -7,6 +7,7 @@
use Smartling\DbAl\UploadQueueManager;
use Smartling\Models\IntegerIterator;
use Smartling\Models\JobInformation;
+use Smartling\Models\UploadQueueItem;
use Smartling\Models\UserTranslationRequest;
use Smartling\Services\ContentRelationsDiscoveryService;
use Smartling\Submissions\SubmissionEntity;
@@ -101,8 +102,8 @@ public function testUploadAttachment()
$submissionsToUpload = 0;
do {
$uploadQueueItem = $uploadQueueManager->dequeue();
- $submissionsToUpload += count($uploadQueueItem->getSubmissions());
- $batchUid = $uploadQueueItem->getBatchUid();
+ $submissionsToUpload += count($uploadQueueItem->submissions);
+ $batchUid = $uploadQueueItem->batchUid;
$this->assertNotEquals('', $batchUid);
} while ($uploadQueueManager->count() > 0);
$this->assertEquals(2, $submissionsToUpload);
diff --git a/tests/Models/TranslationRequestTest.php b/tests/Models/TranslationRequestTest.php
index 77fb47dc..78b44cc5 100644
--- a/tests/Models/TranslationRequestTest.php
+++ b/tests/Models/TranslationRequestTest.php
@@ -3,6 +3,7 @@
namespace Smartling\Tests\Models;
use PHPUnit\Framework\TestCase;
+use Smartling\Models\JobInformation;
use Smartling\Models\UserTranslationRequest;
use Smartling\Services\ContentRelationsHandler;
@@ -39,11 +40,17 @@ public function testFromArray()
$this->assertEquals($sourceId, $x->getContentId());
$this->assertEquals($sourceContentType, $x->getContentType());
$this->assertEquals([1 => [$targetBlogId => ['post' => [3]]], 2 => [$targetBlogId => ['attachment' => [5]]]], $x->getRelationsOrdered());
- $this->assertFalse($x->getJobInformation()->isAuthorize());
- $this->assertEquals($jobDescription, $x->getJobInformation()->getDescription());
- $this->assertEquals($jobDueDate, $x->getJobInformation()->getDueDate());
- $this->assertEquals($jobName, $x->getJobInformation()->getName());
- $this->assertEquals($jobTimeZone, $x->getJobInformation()->getTimeZone());
- $this->assertEquals($jobUid, $x->getJobInformation()->getId());
+ $jobInformation1 = $x->getJobInformation();
+ $this->assertFalse($jobInformation1->authorize);
+ $jobInformation3 = $x->getJobInformation();
+ $this->assertEquals($jobDescription, $jobInformation3->description);
+ $jobInformation4 = $x->getJobInformation();
+ $this->assertEquals($jobDueDate, $jobInformation4->dueDate);
+ $jobInformation2 = $x->getJobInformation();
+ $this->assertEquals($jobName, $jobInformation2->name);
+ $jobInformation5 = $x->getJobInformation();
+ $this->assertEquals($jobTimeZone, $jobInformation5->timeZone);
+ $jobInformation = $x->getJobInformation();
+ $this->assertEquals($jobUid, $jobInformation->id);
}
}
diff --git a/tests/Smartling/Models/UploadQueueItemTest.php b/tests/Smartling/Models/UploadQueueItemTest.php
index fe68b3f5..a5e50d4a 100644
--- a/tests/Smartling/Models/UploadQueueItemTest.php
+++ b/tests/Smartling/Models/UploadQueueItemTest.php
@@ -14,15 +14,16 @@ public function testRemoveSubmission()
$s2 = new SubmissionEntity();
$s2->setId(2);
$x = new UploadQueueItem([$s1, $s2], '', new IntStringPairCollection([new IntStringPair(1, 'a'), new IntStringPair(2, 'b')]));
- foreach ($x->getSubmissions() as $submission) {
+ foreach ($x->submissions as $submission) {
if ($submission->getId() === 1) {
$x = $x->removeSubmission($submission);
}
}
- $this->assertCount(1, $x->getSubmissions());
- $this->assertEquals(2, $x->getSubmissions()[0]->getId());
- $this->assertCount(1, $x->getSmartlingLocales()->getArray());
- $this->assertEquals('b', $x->getSmartlingLocales()->getArray()[0]->getValue());
+ $this->assertCount(1, $x->submissions);
+ $this->assertEquals(2, ($x->submissions)[0]->getId());
+ $this->assertCount(1, $x->smartlingLocales->getArray());
+ $intStringPair = $x->smartlingLocales->getArray()[0];
+ $this->assertEquals('b', $intStringPair->value);
}
public function testSubmissionsAltered()
@@ -32,10 +33,10 @@ public function testSubmissionsAltered()
$s2 = new SubmissionEntity();
$s2->setId(2);
$x = new UploadQueueItem([$s1, $s2], '', new IntStringPairCollection([new IntStringPair(1, 'a'), new IntStringPair(2, 'b')]));
- foreach ($x->getSubmissions() as $submission) {
+ foreach ($x->submissions as $submission) {
$submission->setStatus(SubmissionEntity::SUBMISSION_STATUS_COMPLETED);
}
- foreach ($x->getSubmissions() as $submission) {
+ foreach ($x->submissions as $submission) {
$this->assertEquals(SubmissionEntity::SUBMISSION_STATUS_COMPLETED, $submission->getStatus());
}
}