`%s`
', Sanitize::domain(site_url()) ?? '');
}
- if ($context === 'enable') {
+ if ('enable' === $context) {
if ($this->isPluginReady()) {
return 'Manage WordPress authentication with Auth0.';
}
@@ -950,7 +952,7 @@ private function getOptionDescription(string $context): string
return 'Plugin requires configuration.';
}
- if ($context === 'sync_enable') {
+ if ('sync_enable' === $context) {
if ($this->isPluginReady()) {
return 'If enabled, configuration of WP-Cron is recommended for best performance.';
}
@@ -963,7 +965,7 @@ private function getOptionDescription(string $context): string
private function getOptionPlaceholder(string $context): string
{
- if ($context === 'cookie_domain') {
+ if ('cookie_domain' === $context) {
return Sanitize::domain(site_url()) ?? '';
}
@@ -971,7 +973,7 @@ private function getOptionPlaceholder(string $context): string
}
/**
- * Returns an array of role tags (as strings) identifying all available role options
+ * Returns an array of role tags (as strings) identifying all available role options.
*
* @return mixed[]
*/
@@ -984,9 +986,8 @@ private function getRoleOptions(): array
$response[$roleId] = (string) $role['name'];
}
- $response = array_reverse($response, true);
+ return array_reverse($response, true);
/** @var string[] $response */
- return $response;
}
}
diff --git a/src/Actions/Sync.php b/src/Actions/Sync.php
index 5cc48281..6a372669 100644
--- a/src/Actions/Sync.php
+++ b/src/Actions/Sync.php
@@ -4,35 +4,37 @@
namespace Auth0\WordPress\Actions;
-use WP_User;
use Auth0\SDK\Utility\HttpResponse;
use Auth0\WordPress\Database;
use Psr\Http\Message\ResponseInterface;
+use WP_User;
+
+use function is_array;
final class Sync extends Base
{
/**
* @var string
*/
- public const CONST_JOB_BACKGROUND_SYNC = 'AUTH0_CRON_SYNC';
+ public const CONST_JOB_BACKGROUND_MAINTENANCE = 'AUTH0_CRON_MAINTENANCE';
/**
* @var string
*/
- public const CONST_JOB_BACKGROUND_MAINTENANCE = 'AUTH0_CRON_MAINTENANCE';
+ public const CONST_JOB_BACKGROUND_SYNC = 'AUTH0_CRON_SYNC';
/**
* @var string
*/
- public const CONST_SCHEDULE_BACKGROUND_SYNC = 'AUTH0_SYNC';
+ public const CONST_SCHEDULE_BACKGROUND_MAINTENANCE = 'AUTH0_MAINTENANCE';
/**
* @var string
*/
- public const CONST_SCHEDULE_BACKGROUND_MAINTENANCE = 'AUTH0_MAINTENANCE';
+ public const CONST_SCHEDULE_BACKGROUND_SYNC = 'AUTH0_SYNC';
/**
- * @var array' . $description . '
'; } @@ -78,27 +88,27 @@ public static function option( if (in_array($type, self::TREAT_AS_TEXT, true)) { echo ''; - if (strlen($description) >= 1) { + if ('' !== $description) { echo '' . $description . '
'; } return; } - if ($type === 'textarea') { + if ('textarea' === $type) { echo ''; - if (strlen($description) >= 1) { + if ('' !== $description) { echo '' . $description . '
'; } return; } - if ($type === 'boolean') { - echo ' ' . $description; } } @@ -108,7 +118,7 @@ public static function pageBegin(string $title, ?string $action = 'options.php') echo '