#535: AgaviParameterHolder::hasParameter(), 
AgaviAttributeHolder::hasAttribute(),
AgaviArrayPathDefinition::hasValue() etc return false for keys that have a
null value
--------------------+-------------------------------------------------------
 Reporter:  david   |       Owner:  david    
     Type:  defect  |      Status:  new      
 Priority:  high    |   Milestone:  0.11     
Component:  util    |     Version:  0.11.0RC5
 Severity:  major   |    Keywords:           
--------------------+-------------------------------------------------------
 Reason is the use of {{{isset()}}} instead of {{{array_key_exists()}}}. A
 discussion on IRC showed that one would expect
 {{{
 $x = new AgaviParameterHolder(array('zomg' => null));
 var_dump($x->hasParameter('zomg');
 }}}
 to return {{{true}}}, and not {{{false}}}, as {{{hasParameter()}}} simply
 queries the existance of "zomg", not the value.

 Also, this bug means that
 {{{
 $x = new AgaviParameterHolder(array('zomg' => null));
 var_dump($x->getParameter('zomg', 'lol');
 }}}

 returns "lol" instead of {{{null}}}

 Same applies to AgaviAttributeHolder and AgaviArrayPathDefinition.

-- 
Ticket URL: <http://trac.agavi.org/ticket/535>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5


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

Reply via email to