.../hal/src/Normalizer/TimestampItemNormalizer.php | 1 - .../src/Normalizer/DateTimeIso8601Normalizer.php | 1 - .../src/Normalizer/DateTimeNormalizer.php | 1 - .../src/Unit/Normalizer/DateTimeNormalizerTest.php | 20 +++++++++++--------- .../src/Unit/Normalizer/TimestampNormalizerTest.php | 16 ++++++++++------ 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/core/modules/hal/src/Normalizer/TimestampItemNormalizer.php b/core/modules/hal/src/Normalizer/TimestampItemNormalizer.php index f292940..6f6b2d9 100644 --- a/core/modules/hal/src/Normalizer/TimestampItemNormalizer.php +++ b/core/modules/hal/src/Normalizer/TimestampItemNormalizer.php @@ -5,7 +5,6 @@ use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\Plugin\Field\FieldType\TimestampItem; use Drupal\Core\TypedData\Plugin\DataType\Timestamp; -use Drupal\serialization\Normalizer\TimeStampItemNormalizerTrait; /** * Converts values for TimestampItem to and from common formats for hal. diff --git a/core/modules/serialization/src/Normalizer/DateTimeIso8601Normalizer.php b/core/modules/serialization/src/Normalizer/DateTimeIso8601Normalizer.php index 64b4388..9aa0210 100644 --- a/core/modules/serialization/src/Normalizer/DateTimeIso8601Normalizer.php +++ b/core/modules/serialization/src/Normalizer/DateTimeIso8601Normalizer.php @@ -32,5 +32,4 @@ public function normalize($datetime, $format = NULL, array $context = []) { return parent::normalize($datetime, $format, $context); } - } diff --git a/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php b/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php index cbfec75..ab56714 100644 --- a/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php +++ b/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php @@ -2,7 +2,6 @@ namespace Drupal\serialization\Normalizer; -use Drupal\Core\TypedData\Plugin\DataType\Timestamp; use Drupal\Core\TypedData\Type\DateTimeInterface; use Symfony\Component\Serializer\Exception\UnexpectedValueException; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php index 31ade50..3c98aec 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php @@ -2,12 +2,10 @@ namespace Drupal\Tests\serialization\Unit\Normalizer; -use Drupal\Component\Datetime\DateTimePlus; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\TypedData\Plugin\DataType\DateTimeIso8601; use Drupal\Core\TypedData\Plugin\DataType\IntegerData; -use Drupal\Core\TypedData\Plugin\DataType\Timestamp; use Drupal\Core\TypedData\Type\DateTimeInterface; use Drupal\serialization\Normalizer\DateTimeNormalizer; use Drupal\Tests\UnitTestCase; @@ -63,7 +61,7 @@ protected function setUp() { public function testSupportsNormalization() { $this->assertTrue($this->normalizer->supportsNormalization($this->data->reveal())); - $datetimeiso8601= $this->prophesize(DateTimeIso8601::class); + $datetimeiso8601 = $this->prophesize(DateTimeIso8601::class); $this->assertTrue($this->normalizer->supportsNormalization($datetimeiso8601->reveal())); $integer = $this->prophesize(IntegerData::class); @@ -174,13 +172,17 @@ public function testDenormalizeException() { } -// Note: Prophecy does not support magic methods. By subclassing and specifying -// an explicit method, Prophecy works. -// @see https://github.com/phpspec/prophecy/issues/338 -// @see https://github.com/phpspec/prophecy/issues/34 -// @see https://github.com/phpspec/prophecy/issues/80 +/** + * Note: Prophecy does not support magic methods. By subclassing and specifying + * an explicit method, Prophecy works. + * @see https://github.com/phpspec/prophecy/issues/338 + * @see https://github.com/phpspec/prophecy/issues/34 + * @see https://github.com/phpspec/prophecy/issues/80 + */ class DateTimeNormalizerTestDrupalDateTime extends DrupalDateTime { + public function setTimezone(\DateTimeZone $timezone) { parent::setTimezone($timezone); } -} \ No newline at end of file + +} diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php index 8ba3d82..d96f9a8 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/TimestampNormalizerTest.php @@ -132,13 +132,17 @@ public function testDenormalizeException() { } -// Note: Prophecy does not support magic methods. By subclassing and specifying -// an explicit method, Prophecy works. -// @see https://github.com/phpspec/prophecy/issues/338 -// @see https://github.com/phpspec/prophecy/issues/34 -// @see https://github.com/phpspec/prophecy/issues/80 +/** + * Note: Prophecy does not support magic methods. By subclassing and specifying + * an explicit method, Prophecy works. + * @see https://github.com/phpspec/prophecy/issues/338 + * @see https://github.com/phpspec/prophecy/issues/34 + * @see https://github.com/phpspec/prophecy/issues/80 + */ class TimestampNormalizerTestDrupalDateTime extends DrupalDateTime { + public function setTimezone(\DateTimeZone $timezone) { parent::setTimezone($timezone); } -} \ No newline at end of file + +}