<?php

namespace Percy\Decorator\Date;

use DateTime;

class TimestampDecorator implements DecoratorInterface
{
    /**
     * {@inheritdoc}
     */
    public function __invoke(EntityInterface $entity, array $properties = [])
    {
        foreach ($properties as $property) {
            if (isset($entity[$property])) {
                $entity[$property] = (new DateTime($entity[$property]))->format('U');
            }
        }
    }
}

<?php

namespace Percy\Decorator\Date;

use DateTime;

class TimestampDecorator implements DecoratorInterface
{
    /**
     * {@inheritdoc}
     */
    public function __invoke(EntityInterface $entity, array $properties = [])
    {
        foreach ($properties as $property) {
            if (isset($entity[$property])) {
                $entity[$property] = (new DateTime)->format('U');
            }
        }
    }
}

Use current timestamp within decorator
Use current timestamp within decorator
