Ejemplo n.º 1
0
 public function __construct($tag, $data = null, $line = null, $offset = null)
 {
     $tag = (string) $tag;
     if ($tag === '') {
         throw new exceptions\logic('Tag must not be an empty string');
     }
     if ($line !== null) {
         $line = (int) $line;
         if ($line <= 0) {
             throw new exceptions\logic('Line must be greater than 0');
         }
     }
     if ($offset !== null) {
         $offset = (int) $offset;
         if ($offset <= 0) {
             throw new exceptions\logic('Offset must be greater than 0');
         }
     }
     parent::__construct($data);
     $this->tag = $tag;
     $this->line = $line;
     $this->offset = $offset;
 }