Пример #1
0
 public function offsetSet($index, $newval)
 {
     if (!$this->allowed($index)) {
         throw new PolicyBagException("Input contains restricted item '{$index}'");
     }
     parent::offsetSet($index, $newval);
 }
Пример #2
0
 /**
  * @covers                   \JetBag\Bag::__get
  *
  * @dataProvider providerMagicGetNotFound
  *
  * @expectedException \JetBag\Exceptions\BagException
  * @expectedExceptionMessageFormat Key '%s' not found
  */
 public function testMagicGetNotFound($key, $property)
 {
     $bag = Bag::make(array($key => "key '{$key}'"));
     $bag->{$property};
 }