diff options
-rw-r--r-- | php/src/Google/Protobuf/Timestamp.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/php/src/Google/Protobuf/Timestamp.php b/php/src/Google/Protobuf/Timestamp.php index 7da8e956..f2286ab4 100644 --- a/php/src/Google/Protobuf/Timestamp.php +++ b/php/src/Google/Protobuf/Timestamp.php @@ -159,14 +159,10 @@ class Timestamp extends \Google\Protobuf\Internal\Message /** * Converts PHP DateTime to Timestamp. * - * @param DateTime $datetime + * @param \DateTime $datetime */ - public function fromDateTime($datetime) + public function fromDateTime(\DateTime $datetime) { - if (get_class($datetime) !== \DateTime::class) { - trigger_error("Given parameter is not a DateTime.", - E_USER_ERROR); - } $this->seconds = $datetime->format('U'); $this->nanos = 0; } @@ -174,7 +170,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message /** * Converts Timestamp to PHP DateTime. Nano second is ignored. * - * @return DateTime $datetime + * @return \DateTime $datetime */ public function toDateTime() { |