コード例 #1
0
ファイル: DateTime.php プロジェクト: wscore/site
 /**
  * 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();
 }