diff --git a/lib/API/JSON/v1/Forms.php b/lib/API/JSON/v1/Forms.php index 4ea1a414f0..cb937a0ad9 100644 --- a/lib/API/JSON/v1/Forms.php +++ b/lib/API/JSON/v1/Forms.php @@ -99,7 +99,7 @@ class Forms extends APIEndpoint { if (!$status) { 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])) { return $this->badRequest([ - APIError::BAD_REQUEST => + APIError::BAD_REQUEST => sprintf( __('Invalid status. Allowed values are (%1$s), you specified %2$s', 'mailpoet'), join(', ', [FormEntity::STATUS_ENABLED, FormEntity::STATUS_DISABLED]), diff --git a/lib/API/JSON/v1/ImportExport.php b/lib/API/JSON/v1/ImportExport.php index 62db24ed1a..999e7d1595 100644 --- a/lib/API/JSON/v1/ImportExport.php +++ b/lib/API/JSON/v1/ImportExport.php @@ -107,11 +107,11 @@ class ImportExport extends APIEndpoint { return $this->successResponse($response); } catch (ValidationException $exception) { return $this->badRequest([ - APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'), + APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'), ]); } catch (InvalidArgumentException $exception) { 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'), ]); } } diff --git a/lib/API/JSON/v1/Newsletters.php b/lib/API/JSON/v1/Newsletters.php index bbf91a257a..60a2a7a82a 100644 --- a/lib/API/JSON/v1/Newsletters.php +++ b/lib/API/JSON/v1/Newsletters.php @@ -162,7 +162,7 @@ class Newsletters extends APIEndpoint { if (!$status) { return $this->badRequest([ - APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'), + APIError::BAD_REQUEST => __('You need to specify a status.', 'mailpoet'), ]); } diff --git a/lib/API/JSON/v1/Segments.php b/lib/API/JSON/v1/Segments.php index 5d1d4c74c2..45c5f55411 100644 --- a/lib/API/JSON/v1/Segments.php +++ b/lib/API/JSON/v1/Segments.php @@ -123,11 +123,11 @@ class Segments extends APIEndpoint { $segment = $this->segmentSavecontroller->save($data); } catch (ValidationException $exception) { return $this->badRequest([ - APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'), + APIError::BAD_REQUEST => __('Please specify a name.', 'mailpoet'), ]); } catch (ConflictException $exception) { 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); diff --git a/lib/API/JSON/v1/Services.php b/lib/API/JSON/v1/Services.php index 939783470d..f4f04a3dd9 100644 --- a/lib/API/JSON/v1/Services.php +++ b/lib/API/JSON/v1/Services.php @@ -76,7 +76,7 @@ class Services extends APIEndpoint { if (!$key) { 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) { return $this->badRequest([ - APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'), + APIError::BAD_REQUEST => $this->wp->__('Please specify a key.', 'mailpoet'), ]); } diff --git a/lib/AdminPages/Pages/FormEditor.php b/lib/AdminPages/Pages/FormEditor.php index 097520f5dc..0d1af0f9bd 100644 --- a/lib/AdminPages/Pages/FormEditor.php +++ b/lib/AdminPages/Pages/FormEditor.php @@ -240,8 +240,8 @@ class FormEditor { $data = [ 'form' => $form->toArray(), 'form_exports' => [ - 'php' => Export::get('php'), - 'iframe' => Export::get('iframe'), + 'php' => Export::get('php'), + 'iframe' => Export::get('iframe'), 'shortcode' => Export::get('shortcode'), ], 'segments' => $this->segmentsListRepository->getListWithSubscribedSubscribersCounts([SegmentEntity::TYPE_DEFAULT]), diff --git a/lib/Form/Util/Export.php b/lib/Form/Util/Export.php index 776a80aa0d..d73a5e1a54 100644 --- a/lib/Form/Util/Export.php +++ b/lib/Form/Util/Export.php @@ -9,9 +9,9 @@ use MailPoet\WP\Functions as WPFunctions; class Export { public static function getAll() { return [ - 'html' => static::get('html'), - 'php' => static::get('php'), - 'iframe' => static::get('iframe'), + 'html' => static::get('html'), + 'php' => static::get('php'), + 'iframe' => static::get('iframe'), 'shortcode' => static::get('shortcode'), ]; } diff --git a/lib/PostEditorBlocks/MarketingOptinBlock.php b/lib/PostEditorBlocks/MarketingOptinBlock.php index 0eaab8af55..6273b1550c 100644 --- a/lib/PostEditorBlocks/MarketingOptinBlock.php +++ b/lib/PostEditorBlocks/MarketingOptinBlock.php @@ -35,11 +35,11 @@ class MarketingOptinBlock implements IntegrationInterface { */ public function initialize() { $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 : [ 'dependencies' => [], - 'version' => Env::$version, + 'version' => Env::$version, ]; $this->wp->wpRegisterScript( 'mailpoet-marketing-optin-block-frontend', diff --git a/lib/PostEditorBlocks/WooCommerceBlocksIntegration.php b/lib/PostEditorBlocks/WooCommerceBlocksIntegration.php index 5bb5b621eb..c6d4db0dfd 100644 --- a/lib/PostEditorBlocks/WooCommerceBlocksIntegration.php +++ b/lib/PostEditorBlocks/WooCommerceBlocksIntegration.php @@ -75,7 +75,7 @@ class WooCommerceBlocksIntegration { public function registerCheckoutFrontendBlocks($integration_registry) { $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), 'defaultStatus' => $this->woocommerceSubscription->isCurrentUserSubscribed(), ], @@ -95,13 +95,13 @@ class WooCommerceBlocksIntegration { $extend = Package::container()->get(ExtendRestApi::class); $extend->register_endpoint_data( [ - 'endpoint' => CheckoutSchema::IDENTIFIER, - 'namespace' => 'mailpoet', + 'endpoint' => CheckoutSchema::IDENTIFIER, + 'namespace' => 'mailpoet', 'schema_callback' => function () { return [ 'optin' => [ 'description' => __('Subscribe to marketing opt-in.', 'mailpoet'), - 'type' => 'boolean', + 'type' => 'boolean', ], ]; }, diff --git a/tests/_support/StatisticsExtension.php b/tests/_support/StatisticsExtension.php index aa1417dfc1..b082345225 100644 --- a/tests/_support/StatisticsExtension.php +++ b/tests/_support/StatisticsExtension.php @@ -29,11 +29,11 @@ class StatisticsExtension extends Extension { // we are listening for events public static $events = [ - Events::TEST_BEFORE => 'beforeTest', - Events::TEST_END => 'afterTest', - Events::SUITE_AFTER => 'afterSuite', - Events::STEP_BEFORE => 'beforeStep', - Events::STEP_AFTER => 'afterStep', + Events::TEST_BEFORE => 'beforeTest', + Events::TEST_END => 'afterTest', + Events::SUITE_AFTER => 'afterSuite', + Events::STEP_BEFORE => 'beforeStep', + Events::STEP_AFTER => 'afterStep', ]; public function _initialize() { @@ -75,7 +75,7 @@ class StatisticsExtension extends Extension { // stack overflow: http://stackoverflow.com/questions/16825240/how-to-convert-microtime-to-hhmmssuu $seconds_input = $e->getTime(); $seconds = (int)($milliseconds = (int)($seconds_input * 1000)) / 1000; - $time = ((int)$seconds % 60); + $time = ((int)$seconds % 60); $test->time = $time; self::$testTimes[] = $test; }