Commit b77a57dc authored by Fernando Andrés Muñoz Bravo's avatar Fernando Andrés Muñoz Bravo Committed by Fernando Andrés Muñoz Bravo
Browse files

Issue #3299862 by jonas-gerosa361, alanmoreira, sourabhjain, Meeni_Dhobale,...

Issue #3299862 by jonas-gerosa361, alanmoreira, sourabhjain, Meeni_Dhobale, waspper: Drupal Coding standards are not followed
parent 968cd67f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -152,7 +152,10 @@ function auctioneer_commerce_form_auction_type_form_alter(&$form, FormStateInter
      ]) &&
      $field_name != 'id'
    ) {
      $bid_allowed_fields[$field_name] = t('Field name "@field_name" (@field_label)', ['@field_name' => $field_name, '@field_label' => $field_definition->getLabel()]);
      $bid_allowed_fields[$field_name] = t('Field name "@field_name" (@field_label)', [
        '@field_name' => $field_name,
        '@field_label' => $field_definition->getLabel(),
      ]);
    }
  }
  $form['commerce']['bid_amount_field_name'] = [
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ namespace Drupal\auctioneer_commerce;
use Drupal\auctioneer\Entity\AuctionTypeInterface;

/**
 * Interface AuctionCommerceManagerInterface.
 * Provides managing service for auction commerce integration.
 */
interface AuctionCommerceManagerInterface {

+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ namespace Drupal\auctioneer_datetime_range\Batch;
use Drupal\auctioneer_datetime_range\DatetimeRangeAuctionTypeInterface;

/**
 * Class CheckAuctionDatesBatch.
 * Provides managing service for auction datetime range.
 */
class CheckAuctionDatesBatch {

+14 −8
Original line number Diff line number Diff line
@@ -104,11 +104,14 @@ abstract class AuctionTypeDefault extends AuctionType implements DatetimeRangeAu
   * {@inheritdoc}
   */
  public function processBidForm(array &$form, FormStateInterface $form_state) {
    /* @var \Drupal\auctioneer\Entity\BidInterface $bid */
    /** @var \Drupal\auctioneer\Entity\BidInterface $bid */
    $bid = $form_state->getFormObject()->getEntity();
    /* @var \Drupal\auctioneer\Entity\AuctionInterface $auction */
    /** @var \Drupal\auctioneer\Entity\AuctionInterface $auction */
    $auction = $bid->getAuction();
    if (!$this->auctionIsInDateRange($auction) && !in_array($auction->getAuctionState(), ['paused', 'closed'])) {
    if (!$this->auctionIsInDateRange($auction) && !in_array($auction->getAuctionState(), [
      'paused',
      'closed',
    ])) {
      // Don't show form if current date is not into the auction defined range.
      $form['#access'] = FALSE;
    }
@@ -119,9 +122,9 @@ abstract class AuctionTypeDefault extends AuctionType implements DatetimeRangeAu
   * {@inheritdoc}
   */
  public function validateBidForm(array &$form, FormStateInterface $form_state) {
    /* @var \Drupal\auctioneer\Entity\BidInterface $bid */
    /** @var \Drupal\auctioneer\Entity\BidInterface $bid */
    $bid = $form_state->getFormObject()->getEntity();
    /* @var \Drupal\auctioneer\Entity\AuctionInterface $auction */
    /** @var \Drupal\auctioneer\Entity\AuctionInterface $auction */
    $auction = $bid->getAuction();
    if ($auction) {
      // Just a last stand.
@@ -143,8 +146,11 @@ abstract class AuctionTypeDefault extends AuctionType implements DatetimeRangeAu
    $now_date = new DrupalDateTime();
    $start_date = $auction_dates->start_date;
    $end_date = $auction_dates->end_date;
    if ($start_date instanceof DrupalDateTime && $end_date instanceof DrupalDateTime) {
      list($interval_s, $interval_e) = [$start_date->diff($now_date), $now_date->diff($end_date)];
    if ($now_date instanceof DrupalDateTime && $start_date instanceof DrupalDateTime && $end_date instanceof DrupalDateTime) {
      [$interval_s, $interval_e] = [
        $start_date->diff($now_date),
        $now_date->diff($end_date),
      ];
      if (($interval_s->invert === 1) || ($interval_e->invert === 1)) {
        return FALSE;
      }
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ use Drupal\auctioneer\Entity\AuctionInterface;
use Drupal\auctioneer_datetime_range\DatetimeRangeAuctionTypeManagerInterface;

/**
 * Interface AuctionSniperManagerInterface.
 * Provides managing service for auction sniper.
 */
interface AuctionSniperManagerInterface {

Loading