Exemplo n.º 1
0
 private function parse($contents)
 {
     $data = CollectionUtils::toList($contents);
     // schemes
     $this->securities = new Map();
     foreach ($data as $security) {
         foreach ($security as $id => $scopes) {
             $this->securities->set($id, new Set($scopes));
         }
     }
 }
Exemplo n.º 2
0
 public function testToList()
 {
     $data = ['a' => 'b', 'c' => [1, ['x' => 'y'], 4], 'd' => ['x' => 'y', 'z' => 'zz']];
     $list = CollectionUtils::toList($data);
     $this->assertTrue($list instanceof ArrayList);
     $this->assertEquals('b', $list->get(0));
     $this->assertTrue($list->get(2) instanceof Map);
     $list = new ArrayList($data);
     $this->assertEquals('b', $list->get(0));
     $this->assertFalse($list->get(2) instanceof Map);
 }