Пример #1
0
 /**
  * @see ArrayAccess
  *
  * {@inheritdoc}
  */
 public function offsetSet($offset, $value)
 {
     if ($value instanceof Container) {
         throw new \InvalidArgumentException('This element only accepts inputs');
     }
     $value->val($offset);
     parent::offsetSet($offset, $value);
 }
Пример #2
0
 public function testOffsetSet()
 {
     $this->container->offsetSet('foo', TRUE);
     $this->assertTrue($this->container['foo']);
 }
Пример #3
0
 public function testOffsetSet()
 {
     $this->assertEquals(5, $this->object->offsetGet('test')->value);
     $this->object->offsetSet('test.number', 10);
     $this->assertEquals(10, $this->object->offsetGet('test')->value);
 }
Пример #4
0
 /**
  * @see ArrayAccess
  *
  * {@inheritdoc}
  */
 public function offsetSet($offset, $value)
 {
     parent::offsetSet($offset, $value);
     $value->setKey($offset);
 }