← Back to team overview

anewt-developers team mailing list archive

[Branch ~sander-sinaasappel/anewt/anewt.new.cxs] Rev 1485: [form] Moved assertion to AnewtFormOption

 

------------------------------------------------------------
revno: 1485
committer: Sander van Schouwenburg <sander@xxxxxxxxxxxxx>
branch nick: anewt.new.cxs
timestamp: Tue 2009-07-21 10:31:24 +0200
message:
  [form] Moved assertion to AnewtFormOption
  
  Moved the string assertion from AnewtFormControlChoice::add_option_value_label
  to AnewtFormOption::__construct.
  
  
  (from anewt.new.svn:94)
modified:
  form/controls/choice.lib.php

=== modified file 'form/controls/choice.lib.php'
--- form/controls/choice.lib.php	2009-07-20 15:55:30 +0000
+++ form/controls/choice.lib.php	2009-07-21 08:31:24 +0000
@@ -378,7 +378,6 @@
 	 */
 	function add_option_value_label($value, $label)
 	{
-		assert('is_string($value)');
 		$option = new AnewtFormOption($value, $label);
 		$this->add_option($option);
 	}
@@ -601,6 +600,7 @@
 	 */
 	function __construct($value=null, $label=null)
 	{
+		assert('is_string($value)');
 		$this->_seed(array(
 			'value'	=> $value,
 			'label'	=> $label,



--
lp:~sander-sinaasappel/anewt/anewt.new.cxs
https://code.launchpad.net/~sander-sinaasappel/anewt/anewt.new.cxs

Your team Anewt developers is subscribed to branch lp:~sander-sinaasappel/anewt/anewt.new.cxs.
To unsubscribe from this branch go to https://code.launchpad.net/~sander-sinaasappel/anewt/anewt.new.cxs/+edit-subscription.