Fix spaces in assignments
[MAILPOET-3912]
This commit is contained in:
@@ -99,7 +99,7 @@ class Forms extends APIEndpoint {
|
|||||||
|
|
||||||
if (!$status) {
|
if (!$status) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'),
|
APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ class Forms extends APIEndpoint {
|
|||||||
|
|
||||||
if (!in_array($status, [FormEntity::STATUS_ENABLED, FormEntity::STATUS_DISABLED])) {
|
if (!in_array($status, [FormEntity::STATUS_ENABLED, FormEntity::STATUS_DISABLED])) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST =>
|
APIError::BAD_REQUEST =>
|
||||||
sprintf(
|
sprintf(
|
||||||
__('Invalid status. Allowed values are (%1$s), you specified %2$s', 'mailpoet'),
|
__('Invalid status. Allowed values are (%1$s), you specified %2$s', 'mailpoet'),
|
||||||
join(', ', [FormEntity::STATUS_ENABLED, FormEntity::STATUS_DISABLED]),
|
join(', ', [FormEntity::STATUS_ENABLED, FormEntity::STATUS_DISABLED]),
|
||||||
|
@@ -107,11 +107,11 @@ class ImportExport extends APIEndpoint {
|
|||||||
return $this->successResponse($response);
|
return $this->successResponse($response);
|
||||||
} catch (ValidationException $exception) {
|
} catch (ValidationException $exception) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'),
|
APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
} catch (InvalidArgumentException $exception) {
|
} catch (InvalidArgumentException $exception) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('Another record already exists. Please specify a different "name".', 'mailpoet'),
|
APIError::BAD_REQUEST => __('Another record already exists. Please specify a different "name".', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -162,7 +162,7 @@ class Newsletters extends APIEndpoint {
|
|||||||
|
|
||||||
if (!$status) {
|
if (!$status) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'),
|
APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,11 +123,11 @@ class Segments extends APIEndpoint {
|
|||||||
$segment = $this->segmentSavecontroller->save($data);
|
$segment = $this->segmentSavecontroller->save($data);
|
||||||
} catch (ValidationException $exception) {
|
} catch (ValidationException $exception) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'),
|
APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
} catch (ConflictException $exception) {
|
} catch (ConflictException $exception) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => __('Another record already exists. Please specify a different "name".', 'mailpoet'),
|
APIError::BAD_REQUEST => __('Another record already exists. Please specify a different "name".', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$response = $this->segmentsResponseBuilder->build($segment);
|
$response = $this->segmentsResponseBuilder->build($segment);
|
||||||
|
@@ -76,7 +76,7 @@ class Services extends APIEndpoint {
|
|||||||
|
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'),
|
APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class Services extends APIEndpoint {
|
|||||||
|
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
return $this->badRequest([
|
return $this->badRequest([
|
||||||
APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'),
|
APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -240,8 +240,8 @@ class FormEditor {
|
|||||||
$data = [
|
$data = [
|
||||||
'form' => $form->toArray(),
|
'form' => $form->toArray(),
|
||||||
'form_exports' => [
|
'form_exports' => [
|
||||||
'php' => Export::get('php'),
|
'php' => Export::get('php'),
|
||||||
'iframe' => Export::get('iframe'),
|
'iframe' => Export::get('iframe'),
|
||||||
'shortcode' => Export::get('shortcode'),
|
'shortcode' => Export::get('shortcode'),
|
||||||
],
|
],
|
||||||
'segments' => $this->segmentsListRepository->getListWithSubscribedSubscribersCounts([SegmentEntity::TYPE_DEFAULT]),
|
'segments' => $this->segmentsListRepository->getListWithSubscribedSubscribersCounts([SegmentEntity::TYPE_DEFAULT]),
|
||||||
|
@@ -9,9 +9,9 @@ use MailPoet\WP\Functions as WPFunctions;
|
|||||||
class Export {
|
class Export {
|
||||||
public static function getAll() {
|
public static function getAll() {
|
||||||
return [
|
return [
|
||||||
'html' => static::get('html'),
|
'html' => static::get('html'),
|
||||||
'php' => static::get('php'),
|
'php' => static::get('php'),
|
||||||
'iframe' => static::get('iframe'),
|
'iframe' => static::get('iframe'),
|
||||||
'shortcode' => static::get('shortcode'),
|
'shortcode' => static::get('shortcode'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -35,11 +35,11 @@ class MarketingOptinBlock implements IntegrationInterface {
|
|||||||
*/
|
*/
|
||||||
public function initialize() {
|
public function initialize() {
|
||||||
$script_asset_path = Env::$assetsUrl . '/dist/js/marketing_optin_block/marketing-optin-block-frontend.asset.php';
|
$script_asset_path = Env::$assetsUrl . '/dist/js/marketing_optin_block/marketing-optin-block-frontend.asset.php';
|
||||||
$script_asset = file_exists($script_asset_path)
|
$script_asset = file_exists($script_asset_path)
|
||||||
? require $script_asset_path
|
? require $script_asset_path
|
||||||
: [
|
: [
|
||||||
'dependencies' => [],
|
'dependencies' => [],
|
||||||
'version' => Env::$version,
|
'version' => Env::$version,
|
||||||
];
|
];
|
||||||
$this->wp->wpRegisterScript(
|
$this->wp->wpRegisterScript(
|
||||||
'mailpoet-marketing-optin-block-frontend',
|
'mailpoet-marketing-optin-block-frontend',
|
||||||
|
@@ -75,7 +75,7 @@ class WooCommerceBlocksIntegration {
|
|||||||
public function registerCheckoutFrontendBlocks($integration_registry) {
|
public function registerCheckoutFrontendBlocks($integration_registry) {
|
||||||
$integration_registry->register(new MarketingOptinBlock(
|
$integration_registry->register(new MarketingOptinBlock(
|
||||||
[
|
[
|
||||||
'defaultText' => $this->settings->get('woocommerce.optin_on_checkout.message', ''),
|
'defaultText' => $this->settings->get('woocommerce.optin_on_checkout.message', ''),
|
||||||
'optinEnabled' => $this->settings->get('woocommerce.optin_on_checkout.enabled', false),
|
'optinEnabled' => $this->settings->get('woocommerce.optin_on_checkout.enabled', false),
|
||||||
'defaultStatus' => $this->woocommerceSubscription->isCurrentUserSubscribed(),
|
'defaultStatus' => $this->woocommerceSubscription->isCurrentUserSubscribed(),
|
||||||
],
|
],
|
||||||
@@ -95,13 +95,13 @@ class WooCommerceBlocksIntegration {
|
|||||||
$extend = Package::container()->get(ExtendRestApi::class);
|
$extend = Package::container()->get(ExtendRestApi::class);
|
||||||
$extend->register_endpoint_data(
|
$extend->register_endpoint_data(
|
||||||
[
|
[
|
||||||
'endpoint' => CheckoutSchema::IDENTIFIER,
|
'endpoint' => CheckoutSchema::IDENTIFIER,
|
||||||
'namespace' => 'mailpoet',
|
'namespace' => 'mailpoet',
|
||||||
'schema_callback' => function () {
|
'schema_callback' => function () {
|
||||||
return [
|
return [
|
||||||
'optin' => [
|
'optin' => [
|
||||||
'description' => __('Subscribe to marketing opt-in.', 'mailpoet'),
|
'description' => __('Subscribe to marketing opt-in.', 'mailpoet'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
@@ -29,11 +29,11 @@ class StatisticsExtension extends Extension {
|
|||||||
|
|
||||||
// we are listening for events
|
// we are listening for events
|
||||||
public static $events = [
|
public static $events = [
|
||||||
Events::TEST_BEFORE => 'beforeTest',
|
Events::TEST_BEFORE => 'beforeTest',
|
||||||
Events::TEST_END => 'afterTest',
|
Events::TEST_END => 'afterTest',
|
||||||
Events::SUITE_AFTER => 'afterSuite',
|
Events::SUITE_AFTER => 'afterSuite',
|
||||||
Events::STEP_BEFORE => 'beforeStep',
|
Events::STEP_BEFORE => 'beforeStep',
|
||||||
Events::STEP_AFTER => 'afterStep',
|
Events::STEP_AFTER => 'afterStep',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function _initialize() {
|
public function _initialize() {
|
||||||
@@ -75,7 +75,7 @@ class StatisticsExtension extends Extension {
|
|||||||
// stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu
|
// stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu
|
||||||
$seconds_input = $e->getTime();
|
$seconds_input = $e->getTime();
|
||||||
$seconds = (int)($milliseconds = (int)($seconds_input * 1000)) / 1000;
|
$seconds = (int)($milliseconds = (int)($seconds_input * 1000)) / 1000;
|
||||||
$time = ((int)$seconds % 60);
|
$time = ((int)$seconds % 60);
|
||||||
$test->time = $time;
|
$test->time = $time;
|
||||||
self::$testTimes[] = $test;
|
self::$testTimes[] = $test;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user