Nah, that's intentional. The idea is that you can set a literal  
"foo[bar]" if you need to (and that will be returned if you get it  
again instead of the entry "bar" in "foo").

Changing that would break BC; I believe; we're relying on it in a  
couple of places, I think.

- David




Am 11.12.2008 um 14:47 schrieb Felix Gilcher:

> Hey,
>
> while writing the tests for #955 I stumbled over the behavior  
> demonstrated in this snippet:
>
> $p = new AgaviParameterHolder();
> $p->setParameter('foo', array('bar' => 'baz', 'ball' => 'round'));
> $p->getParameter('foo[bar]'); // baz
> $p->setParameter('foo[bar]', 'foo');
> $p->getParameter('foo'); // hmm:  array('bar' => 'baz', 'ball' =>  
> 'round'), expected: array('bar' => 'foo', 'ball' => 'round')
> $p->getParameter('foo[bar]'); // foo
> $p->unsetParameter('foo[bar]'); // foo
> $p->getParameter('foo[bar]'); // baz !!! (instead of null)
>
> This is triggered by AgaviParameterHolder::setParameter() not trying  
> to resolve array parts in the name like get/has/unsetParameter() do.  
> I'd call that unexpected and I'd say it's a bug - it took me nearly  
> 15 minutes to figure out what I was doing wrong in my testcase.  
> However it's a bit unclear how to fix that...
>
> Any insights?
>
> cheers
>
> felix
>
> --
> Felix Gilcher
>
> Bitextender GmbH
> Paul-Heyse-Str. 6
> D-80336 München
>
> T: +49 89 57 08 15 16
> F: +49 89 57 08 15 17
> M: +49 172 840 88 28
>
> [EMAIL PROTECTED]
> http://bitextender.com/
>
> Amtsgericht München, HRB 174280
> Geschäftsführer: David Zülke, Florian Clever
>
> _______________________________________________
> Agavi Dev Mailing List
> [email protected]
> http://lists.agavi.org/mailman/listinfo/dev


_______________________________________________
Agavi Dev Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/dev

Reply via email to