public function __construct($value, $varname = null) { $this->setLimit('6'); $value = strtolower($value); $this->setRegexpMatch('/^([a-f]|[0-9]){6}$/'); parent::__construct($value, $varname); }
public function __construct($value) { parent::__construct(strtoupper($value), 1); if (!preg_match('/^[A-Z0-9]$/', (string) $value)) { throw new InvalidFieldException('File Id Modifier "' . $value . '" must be A-Z 0-9.'); } }
public function __construct($value) { $value = strtoupper($value); parent::__construct($value, 3); if (!in_array($value, $this->validClasses)) { throw new InvalidFieldException($value . ' is not a valid standard entry class.'); } }
/** * @param string $value * @param bool $visible */ public function __construct($value, $visible = true) { if (false !== strpos($value, ';')) { throw new \InvalidArgumentException('Keyword should not contain semicolons'); } parent::__construct($value); $this->visible = $visible; }
public function __construct($value) { foreach ($this->triggers as $trigger) { if (stristr(strtolower($value), $trigger)) { $value = strtoupper($value); } } parent::__construct($value, 10); }
/** * @param $filePath string Name of the conf file (or full path). * @throws Exception */ public function __construct($filePath) { $this->inFilePath = $filePath; $contents = @file_get_contents($this->inFilePath); if (false === $contents) { throw new Exception('Cannot read file "' . $this->inFilePath . '".'); } parent::__construct($contents); }
public function __construct($string) { parent::__construct($string); if ($this->getStringLength() >= 1) { $this->pass = $string; } else { throw new \InvalidArgumentException('Password too short'); } }
public function __construct($label, $flags, $timePrecision = null, $timerFormat = null, $val = null, $filterCriteria = null) { $this->timerFormat = $timerFormat; if (isset($timePrecision)) { $this->timePrecision = $timePrecision; } else { $this->timePrecision = 'seconds'; } parent::__construct($label, $flags, $val, $filterCriteria); }
public function __construct($string, $returnMode = 'default') { if (!extension_loaded('mbstring')) { $err = "This class required mbstring extension to be loaded.\r\n\t\t\t\nPlease check you php to make sure you have mbstring extension"; e($err); throw new \RuntimeException($err); } parent::__construct($string, $returnMode); mb_regex_encoding("UTF-8"); mb_internal_encoding("UTF-8"); /** * @todo if have iconv, also set its' encoding to utf-8 */ }
/** * function __contruct get the parameters to them in the parent construct * * @param string $label * @param array $options * @param string $flags * @param string $val * @param string $filterCriteria */ public function __construct($label = null, $options = array(), $flags = null, $val = null, $filterCriteria = null) { $this->options = $options; parent::__construct($label, $flags, $val, $filterCriteria); //echo $this->showInput(true); }
public function __construct($value) { $value = strtolower($value) == 'check destroyed' ? strtoupper($value) : $value; parent::__construct($value, 16); }
/** * @param $value string * @param $type string the type of the displayable object : class, method, property or string */ public function __construct($value, $type) { parent::__construct($value); $this->type = $type; }
/** * @param string $url * @param string $contents * @param string $encoding **/ public function __construct($url, $contents, $encoding = "utf-8") { $this->url = $url; parent::__construct($contents, $encoding); }
/** * Sets a character limit and makes sure the value is a valid email address. * @param string $varname Name of variable * @param string $value Email address */ public function __construct($value = null, $varname = null) { $this->setLimit('80'); $this->setRegexpMatch('/^[\\w.%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$/i'); parent::__construct($value, $varname); }
/** * Checks the value to ensure it is a proper url. * The construct will throw an exception if the string does not pass. * @param string $varname * @param string $value */ public function __construct($value = null, $varname = null) { $this->setRegexpMatch('/^(https?:\\/\\/|\\.\\/|\\/\\/)?\\w([,\\.\\w\\-\\/&;?\\+=~#])+$/i'); parent::__construct($value, $varname); }
/** * <ul> * <li>The default (OFF) value is empty string</li> * <li>The ON value is empty string</li> * <li>HTML content is escaped for output.</li> * <li>No validation of the content of the value</li> * <li>Minimal length is 0 (accepts empty string)</li> * <li>Maximal length is 1024</li> * <li>The parameter is not required</li> * </ul> * * @param string $name The parameter name, case insensitive * @throws \MWException When $name not set */ public function __construct($name) { parent::__construct($name); $this->option_value = ''; }
public function __construct($columnName, $maximumLength = 200, $defaultValue = "") { parent::__construct($columnName, $maximumLength, $defaultValue); }