<?php class UrlConcrete { /** * @param DateTimeInterface|DateTime|null $lastmod * * @return UrlConcrete */ public function setLastmod($lastmod = null) { if (!($lastmod instanceof \DateTimeInterface || $lastmod instanceof \DateTime)) { $typePassed = is_object($lastmod) ? \get_class($lastmod) : \gettype($lastmod); if (\PHP_MAJOR_VERSION >= 7) { throw new \TypeError('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTimeInterface, '$typePassed' given"); } else { \trigger_error('Argument 1 passed to ' . __METHOD__ . "() must be an instance of DateTime, '$typePassed' given", E_USER_ERROR); return $this; } } $this->lastmod = $lastmod; return $this; } } $x = new UrlConcrete(); $x->setLastmod(new \DateTime()); $x->setLastmod(new stdclass());
You have javascript disabled. You will not be able to edit any code.