Exemple #1
0
 public static function yesNo($msg, LogInterface &$log)
 {
     \apf\validate\String::mustBeString($msg);
     $msg = sprintf('%s (y/n):', $msg);
     $options = ['y', 'yes', 'ya', 'ye', 'yeah', 'yep', 'n', 'no', 'nope', 'negative'];
     $select = substr(self::select($options, $msg, $log), 0, 1);
     return $select == "y";
 }
Exemple #2
0
 public function __construct($value)
 {
     \apf\validate\String::mustBeString($value, $trim = TRUE);
     $this->value = sprintf('%s', $value);
 }