Loading scheduler.tokens.inc +3 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ use Drupal\Core\Render\BubbleableMetadata; * Implements hook_token_info(). */ function scheduler_token_info() { // Initialise the array to avoid 'variable is undefined' phpcs error. $info = []; $info['tokens']['node']['scheduler-publish'] = [ 'name' => t('Publish on date'), 'description' => t("The date the node will be published."), Loading @@ -31,7 +33,7 @@ function scheduler_token_info() { function scheduler_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { $token_service = \Drupal::token(); $date_formatter = \Drupal::service('date.formatter'); $language_code = isset($options['langcode']) ? $options['langcode'] : NULL; $language_code = $options['langcode'] ?? NULL; $replacements = []; if ($type == 'node' && !empty($data['node'])) { Loading scheduler_rules_integration/scheduler_rules_integration.rules_defaults.inc +3 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,9 @@ * @todo Convert to 8.x, this is stil 7.x code */ function scheduler_rules_integration_default_rules_configuration() { // Initialise the array to avoid 'variable is undefined' phpcs error. $configs = []; // Define two reaction rules which will be displayed on the 'Rules' tab. These // are initially inactive, but the user can enable them, and then modify the // values and/or add more conditions and actions. Loading tests/modules/scheduler_api_test/src/EventSubscriber.php +3 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,9 @@ class EventSubscriber implements EventSubscriberInterface { * {@inheritdoc} */ public static function getSubscribedEvents() { // Initialise the array to avoid 'variable is undefined' phpcs error. $events = []; // The values in the arrays give the function names below. $events[SchedulerEvents::PRE_PUBLISH][] = ['apiTestPrePublish']; $events[SchedulerEvents::PUBLISH][] = ['apiTestPublish']; Loading Loading
scheduler.tokens.inc +3 −1 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ use Drupal\Core\Render\BubbleableMetadata; * Implements hook_token_info(). */ function scheduler_token_info() { // Initialise the array to avoid 'variable is undefined' phpcs error. $info = []; $info['tokens']['node']['scheduler-publish'] = [ 'name' => t('Publish on date'), 'description' => t("The date the node will be published."), Loading @@ -31,7 +33,7 @@ function scheduler_token_info() { function scheduler_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) { $token_service = \Drupal::token(); $date_formatter = \Drupal::service('date.formatter'); $language_code = isset($options['langcode']) ? $options['langcode'] : NULL; $language_code = $options['langcode'] ?? NULL; $replacements = []; if ($type == 'node' && !empty($data['node'])) { Loading
scheduler_rules_integration/scheduler_rules_integration.rules_defaults.inc +3 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,9 @@ * @todo Convert to 8.x, this is stil 7.x code */ function scheduler_rules_integration_default_rules_configuration() { // Initialise the array to avoid 'variable is undefined' phpcs error. $configs = []; // Define two reaction rules which will be displayed on the 'Rules' tab. These // are initially inactive, but the user can enable them, and then modify the // values and/or add more conditions and actions. Loading
tests/modules/scheduler_api_test/src/EventSubscriber.php +3 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,9 @@ class EventSubscriber implements EventSubscriberInterface { * {@inheritdoc} */ public static function getSubscribedEvents() { // Initialise the array to avoid 'variable is undefined' phpcs error. $events = []; // The values in the arrays give the function names below. $events[SchedulerEvents::PRE_PUBLISH][] = ['apiTestPrePublish']; $events[SchedulerEvents::PUBLISH][] = ['apiTestPublish']; Loading