/** * Preloads the string * * @param scalar * @return mixed */ public function __construct($data) { //argument 1 must be scalar Argument::i()->test(1, 'scalar'); $data = (string) $data; parent::__construct($data); }
/** * Preloads the array * * @param array * @return mixed */ public function __construct($data = array()) { //if there is more arguments or data is not an array if (func_num_args() > 1 || !is_array($data)) { //just get the args $data = func_get_args(); } parent::__construct($data); }