コード例 #1
0
 /**
  * @param array $data
  * @return MapInterface
  */
 public function deserialize(array $data)
 {
     $data = new Dictionary($data);
     $collection = new Dictionary();
     $serializer = new ToggleSerializer(new OperatorConditionSerializer(new OperatorSerializer()));
     foreach ($data as $name => $serializedToggle) {
         $toggle = $serializer->deserialize($serializedToggle);
         $collection->set($serializedToggle->get('name'), $toggle);
     }
     return $collection;
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  * @return $this
  */
 public function indexBy($callback)
 {
     $callback = $this->propertyExtractor($callback);
     $group = new Dictionary();
     foreach ($this as $value) {
         $key = $callback($value);
         $group->set($key, $value);
     }
     return $group;
 }
コード例 #3
0
 /**
  * @expectedException \OutOfBoundsException
  */
 public function testGetInvalidItem()
 {
     $this->coll->set('keyOne', 'testing');
     $this->coll->get('keyTwo');
 }