Verified Commit d3a13779 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3425359 by sorlov, quietone, naveenvalecha, smustgrave, alexpott:...

Issue #3425359 by sorlov, quietone, naveenvalecha, smustgrave, alexpott: Convert ViewsArgumentHandlers plugin discovery to attributes

(cherry picked from commit d675ece2)
parent 6e6f3918
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\comment\Plugin\views\argument;

use Drupal\Core\Database\Connection;
use Drupal\views\Attribute\ViewsArgument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

@@ -12,9 +13,10 @@
 * Accepts a user ID to check for nodes that the user posted or commented on.
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("argument_comment_user_uid")
  */
#[ViewsArgument(
  id: 'argument_comment_user_uid',
)]
class UserUid extends ArgumentPluginBase {

  /**
+4 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\Attribute\ViewsArgument;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\argument\Date as NumericDate;

@@ -22,9 +23,10 @@
 * @see \Drupal\views\ManyToOneHelper
 *
 * @ingroup views_argument_handlers
 *
 * @ViewsArgument("datetime")
 */
#[ViewsArgument(
  id: 'datetime',
)]
class Date extends NumericDate {

  use FieldAPIHandlerTrait;
+5 −2
Original line number Diff line number Diff line
@@ -2,11 +2,14 @@

namespace Drupal\datetime\Plugin\views\argument;

use Drupal\views\Attribute\ViewsArgument;

/**
 * Argument handler for a day.
 *
 * @ViewsArgument("datetime_day")
 */
#[ViewsArgument(
  id: 'datetime_day',
)]
class DayDate extends Date {

  /**
+5 −2
Original line number Diff line number Diff line
@@ -2,11 +2,14 @@

namespace Drupal\datetime\Plugin\views\argument;

use Drupal\views\Attribute\ViewsArgument;

/**
 * Argument handler for a full date (CCYYMMDD).
 *
 * @ViewsArgument("datetime_full_date")
 */
#[ViewsArgument(
  id: 'datetime_full_date',
)]
class FullDate extends Date {

  /**
+5 −2
Original line number Diff line number Diff line
@@ -2,11 +2,14 @@

namespace Drupal\datetime\Plugin\views\argument;

use Drupal\views\Attribute\ViewsArgument;

/**
 * Argument handler for a month.
 *
 * @ViewsArgument("datetime_month")
 */
#[ViewsArgument(
  id: 'datetime_month',
)]
class MonthDate extends Date {

  /**
Loading