Example #1
0
 /**
  * Get a property
  *
  * @param  string $name
  * @throws \InvalidArgumentException
  * @return integer
  */
 public function __get($name)
 {
     if (array_key_exists($name, $this->properties)) {
         if (in_array($name, ['W3C', 'ymd', 'iso'])) {
             return (string) $this->format($this->properties[$name]);
         }
         return (int) $this->format($this->properties[$name]);
     }
     switch ($name) {
         case 'is':
             return Compare::start($this);
         case 'diff':
             return Diff::start($this);
     }
     throw new \InvalidArgumentException();
 }