Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
hackzilla
/
password-generator
/
Model
/
Option
/
File Content:
StringOption.php
<?php namespace WPToolkitDependenciesIsolationPrefix\Hackzilla\PasswordGenerator\Model\Option; use InvalidArgumentException; class StringOption extends Option { private $minRange; private $maxRange; /** * {@inheritdoc} */ public function __construct(array $settings = array()) { parent::__construct($settings); $this->minRange = isset($settings['min']) ? $settings['min'] : 0; $this->maxRange = isset($settings['max']) ? $settings['max'] : 255; } /** * {@inheritdoc} */ public function setValue($value) { if (!\is_string($value)) { throw new InvalidArgumentException('String required'); } if ($this->minRange > \strlen($value) || $this->maxRange < \strlen($value)) { throw new InvalidArgumentException('Invalid Value'); } parent::setValue($value); } /** * {@inheritdoc} */ public function getType() { return self::TYPE_STRING; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
BooleanOption.php
511 bytes
0644
IntegerOption.php
1022 bytes
0644
Option.php
1163 bytes
0644
OptionInterface.php
662 bytes
0644
StringOption.php
1015 bytes
0644
N4ST4R_ID | Naxtarrr