Example #1
0
 public function testToString()
 {
     $p = new Position(5, 10);
     $this->assertEquals("(5, 10)", $p->__toString());
     $p = new Position(7, 8, "/foo/bar/baz.ebnf");
     $this->assertEquals("/foo/bar/baz.ebnf (7, 8)", $p->__toString());
 }
 public function get(Position $pos)
 {
     foreach ($this->protect["chest"] as $array) {
         foreach ($array as $t) {
             if ($pos->__toString() === $t->pos->__toString()) {
                 return $t;
             }
         }
     }
     return false;
 }