Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html1/web/core/modules/rest/tests/src/Functional/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html1/web/core/modules/rest/tests/src/Functional/BcTimestampNormalizerUnixTestTrait.php

<?php

namespace Drupal\Tests\rest\Functional;

/**
 * Trait for ResourceTestBase subclasses formatting expected timestamp data.
 */
trait BcTimestampNormalizerUnixTestTrait {

  /**
   * Formats a UNIX timestamp.
   *
   * Depending on the 'bc_timestamp_normalizer_unix' setting. The return will be
   * an RFC3339 date string or the same timestamp that was passed in.
   *
   * @param int $timestamp
   *   The timestamp value to format.
   *
   * @return string|int
   *   The formatted RFC3339 date string or UNIX timestamp.
   *
   * @see \Drupal\serialization\Normalizer\TimestampItemNormalizer
   */
  protected function formatExpectedTimestampItemValues($timestamp) {
    // If the setting is enabled, just return the timestamp as-is now.
    if ($this->config('serialization.settings')->get('bc_timestamp_normalizer_unix')) {
      return ['value' => $timestamp];
    }

    // Otherwise, format the date string to the same that
    // \Drupal\serialization\Normalizer\TimestampItemNormalizer will produce.
    $date = new \DateTime();
    $date->setTimestamp($timestamp);
    // Per \Drupal\Core\TypedData\Plugin\DataType\Timestamp::getDateTime(), they
    // default to string representations in the UTC timezone.
    $date->setTimezone(new \DateTimeZone('UTC'));

    // Format is also added to the expected return values.
    return [
      'value' => $date->format(\DateTime::RFC3339),
      'format' => \DateTime::RFC3339,
    ];
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net