toArray() public method

public toArray ( )
Beispiel #1
0
 public function equals(Scope $that)
 {
     $thisScope = $this->toArray();
     $thatScope = $that->toArray();
     foreach ($thisScope as $s) {
         if (!in_array($s, $thatScope)) {
             return false;
         }
     }
     foreach ($thatScope as $s) {
         if (!in_array($s, $thisScope)) {
             return false;
         }
     }
     return true;
 }
Beispiel #2
0
 public function testSerialize()
 {
     $s = new Scope(array('foo', 'bar', 'baz'));
     $t = new Scope($s->toArray());
     $this->assertTrue($t->equals($s));
 }