Changeset 678
- Timestamp:
- 05/27/07 22:46:10 (1 year ago)
- Files:
-
- trunk/src/main/php/info/phing/tasks/stubUnzipTask.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubAbstractStringFilter.php (modified) (5 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubIntegerFilter.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubMailFilter.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubNumberFilter.php (modified) (6 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubPassThruFilter.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubPasswordFilter.php (modified) (5 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubStringFilter.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/ipo/request/filters/stubTextFilter.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableJoin.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/reflection/annotations/parser/stubAnnotationStateParser.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/util/ext/stubXPClassLoader.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/util/validators/stubMaxNumberValidator.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubMinLengthValidator.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubMinNumberValidator.php (modified) (4 diffs)
- trunk/src/main/php/net/stubbles/util/validators/stubPassThruValidator.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/util/validators/stubRegexValidator.php (modified) (5 diffs)
- trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php (modified) (6 diffs)
- trunk/src/main/php/net/stubbles/websites/xml/stubXMLPageElementCachingDecorator.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/serializer/stubXMLSerializer.php (modified) (2 diffs)
- trunk/src/main/php/net/stubbles/xml/stubAbstractXMLStreamWriter.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/stubDomXMLStreamWriter.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/stubLibXmlXMLStreamWriter.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/stubXMLStreamWriter.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/xml/stubXMLStreamWriterFactory.php (modified) (2 diffs)
- trunk/src/main/php/org/apache/maven/artifact/resolver/mvnAbstractArtifactResolutionException.php (modified) (10 diffs)
- trunk/src/main/php/org/apache/maven/artifact/resolver/mvnDefaultArtifactCollector.php (modified) (25 diffs)
- trunk/src/main/php/org/apache/maven/artifact/resolver/mvnResolutionNode.php (modified) (27 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/info/phing/tasks/stubUnzipTask.php
r349 r678 32 32 */ 33 33 class stubUnzipTask extends ExtractBaseTask { 34 34 35 35 protected function extractArchive(PhingFile $zipfile) 36 36 { … … 40 40 $extractParams['remove_path'] = $this->removepath; 41 41 } 42 42 43 43 $this->log("Extracting zip: " . $zipfile->__toString() . ' to ' . $this->todir->__toString(), PROJECT_MSG_INFO); 44 44 $targetDir = $this->todir->__toString() . '/' . substr($zipfile->getName(), 0, strrpos($zipfile->getName(), '.')); 45 46 try {47 $zip = zip_open($zipfile->getAbsolutePath());48 if (false == $zip) {49 throw new BuildException('Could not open zip file ' . $zipfile->getAbsolutePath());50 }51 45 46 try { 47 $zip = zip_open($zipfile->getAbsolutePath()); 48 if (false == $zip) { 49 throw new BuildException('Could not open zip file ' . $zipfile->getAbsolutePath()); 50 } 51 52 52 while($zipEntry = zip_read($zip)) { 53 53 $entry = zip_entry_open($zip, $zipEntry); … … 67 67 } 68 68 } 69 69 70 70 protected function listArchiveContent(PhingFile $zipfile) 71 71 { trunk/src/main/php/net/stubbles/ipo/request/filters/stubAbstractStringFilter.php
r151 r678 2 2 /** 3 3 * Base class for filtering strings. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 10 10 /** 11 11 * Base class for filtering strings. 12 * 13 * This is a base class for string filtering. It provides methods to check the 14 * minimum and maximum length of a string using validators, but both are 12 * 13 * This is a base class for string filtering. It provides methods to check the 14 * minimum and maximum length of a string using validators, but both are 15 15 * optional checks. 16 16 * … … 33 33 */ 34 34 protected $maxLength = null; 35 36 /**37 * set a min length validator38 *39 * @param stubValidator $minLength40 */41 public function setMinLengthValidator(stubValidator $minLength)42 {43 $this->minLength = $minLength;44 }45 46 /**47 * set a max length validator48 *49 * @param stubValidator $maxLength50 */51 public function setMaxLengthValidator(stubValidator $maxLength)52 {53 $this->maxLength = $maxLength;54 }35 36 /** 37 * set a min length validator 38 * 39 * @param stubValidator $minLength 40 */ 41 public function setMinLengthValidator(stubValidator $minLength) 42 { 43 $this->minLength = $minLength; 44 } 45 46 /** 47 * set a max length validator 48 * 49 * @param stubValidator $maxLength 50 */ 51 public function setMaxLengthValidator(stubValidator $maxLength) 52 { 53 $this->maxLength = $maxLength; 54 } 55 55 56 56 /** … … 63 63 public function execute($value) 64 64 { 65 $value = $this->doExecute($value);66 65 $value = $this->doExecute($value); 66 67 67 // if input length is zero but input is required 68 if ((null == $value || strlen($value) == 0) && true == $this->isRequired) {68 if ((null == $value || strlen($value) == 0) && true == $this->isRequired) { 69 69 throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 70 70 // if input is shorter than maximal allowed length … … 75 75 throw new stubFilterException($this->rveFactory->create('STRING_TOO_LONG')->setValues($this->maxLength->getCriteria())); 76 76 } 77 77 78 78 return $value; 79 79 } 80 80 81 81 /** 82 82 * specialized filtering trunk/src/main/php/net/stubbles/ipo/request/filters/stubIntegerFilter.php
r151 r678 2 2 /** 3 3 * Basic class for filters on request variables of type integer. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 10 10 /** 11 11 * Basic class for filters on request variables of type integer. 12 * 13 * This filter takes any value, casts it to int and checks if it complies 12 * 13 * This filter takes any value, casts it to int and checks if it complies 14 14 * with the min and/or the max validator. 15 15 * … … 27 27 * @param stubValidator $max validator for maximum values 28 28 */ 29 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null)30 {31 parent::__construct($rveFactory, $min, $max);32 }29 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 30 { 31 parent::__construct($rveFactory, $min, $max); 32 } 33 33 34 34 /** … … 39 39 * @throws stubFilterException in case $value has errors 40 40 */ 41 function execute($value)42 {43 if ((strlen($value) > 0 && true == $this->isRequired) || false == $this->isRequired || false === $value) {41 function execute($value) 42 { 43 if ((strlen($value) > 0 && true == $this->isRequired) || false == $this->isRequired || false === $value) { 44 44 settype($value, 'integer'); 45 }46 45 } 46 47 47 return parent::doExecute($value); 48 }48 } 49 49 } 50 50 ?> trunk/src/main/php/net/stubbles/ipo/request/filters/stubMailFilter.php
r337 r678 2 2 /** 3 3 * Class for filtering mail addresses. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 23 23 */ 24 24 protected $mailValidator; 25 25 26 26 /** 27 27 * constructor 28 * 28 * 29 29 * @param stubRequestValueErrorFactory $rveFactory factory to create stubRequestValueErrors 30 30 * @param stubValidator $mailValidator validator to check the mail address 31 31 */ 32 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $mailValidator)33 {34 $this->rveFactory = $rveFactory;35 $this->mailValidator = $mailValidator;36 }32 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $mailValidator) 33 { 34 $this->rveFactory = $rveFactory; 35 $this->mailValidator = $mailValidator; 36 } 37 37 38 38 /** … … 48 48 throw new stubFilterException($this->rveFactory->create('MAILADDRESS_INCORRECT')); 49 49 } 50 50 51 51 return $value; 52 52 } trunk/src/main/php/net/stubbles/ipo/request/filters/stubNumberFilter.php
r151 r678 2 2 /** 3 3 * Basic class for filters on variables of type number. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 13 13 /** 14 14 * Basic class for filters on variables of type number. 15 * 16 * This filter takes any value, casts it to float and checks if it complies 15 * 16 * This filter takes any value, casts it to float and checks if it complies 17 17 * with the min and/or the max validator. 18 18 * … … 35 35 */ 36 36 protected $maxValidator = null; 37 37 38 38 /** 39 39 * constructor … … 43 43 * @param stubValidator $max validator for maximum values 44 44 */ 45 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null)46 {47 $this->rveFactory = $rveFactory;48 $this->minValidator = $min;49 $this->maxValidator = $max;50 }51 45 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 46 { 47 $this->rveFactory = $rveFactory; 48 $this->minValidator = $min; 49 $this->maxValidator = $max; 50 } 51 52 52 /** 53 53 * checks if given value exceeds borders … … 57 57 * @throws stubFilterException in case $value has errors 58 58 */ 59 public function execute($value)60 {61 settype($value, 'float');59 public function execute($value) 60 { 61 settype($value, 'float'); 62 62 return $this->doExecute($value); 63 }64 65 /**63 } 64 65 /** 66 66 * checks if given value exceeds borders 67 67 * … … 70 70 * @throws stubFilterException in case $value has errors 71 71 */ 72 protected function doExecute($value)73 {72 protected function doExecute($value) 73 { 74 74 if ((null === $value || strlen($value) == 0) && true == $this->isRequired) { 75 // add error message if there is no input and input is needed75 // add error message if there is no input and input is needed 76 76 throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 77 77 } elseif (null !== $value && null != $this->minValidator && $this->minValidator->validate($value) != true) { 78 // add error message if input is smaller than minimum value78 // add error message if input is smaller than minimum value 79 79 throw new stubFilterException($this->rveFactory->create('VALUE_TOO_SMALL')->setValues($this->minValidator->getCriteria())); 80 80 } elseif (null !== $value && null != $this->maxValidator && $this->maxValidator->validate($value) != true) { 81 // add error message if input is greater than maximum value81 // add error message if input is greater than maximum value 82 82 throw new stubFilterException($this->rveFactory->create('VALUE_TOO_GREAT')->setValues($this->maxValidator->getCriteria())); 83 83 } 84 84 85 85 return $value; 86 }86 } 87 87 } 88 88 ?> trunk/src/main/php/net/stubbles/ipo/request/filters/stubPassThruFilter.php
r410 r678 2 2 /** 3 3 * Filter that filters nothing. 4 * 4 * 5 5 * Use this filter only when you know what you are doing. 6 * 6 * 7 7 * @author Frank Kleine <mikey@stubbles.net> 8 8 * @package stubbles … … 12 12 /** 13 13 * Filter that filters nothing. 14 * 14 * 15 15 * Use this filter only when you know what you are doing. 16 16 * … … 22 22 /** 23 23 * constructor 24 * 24 * 25 25 * @param stubRequestValueErrorFactory $rveFactory factory to create stubRequestValueErrors 26 26 */ 27 public function __construct(stubRequestValueErrorFactory $rveFactory)28 {29 $this->rveFactory = $rveFactory;30 }27 public function __construct(stubRequestValueErrorFactory $rveFactory) 28 { 29 $this->rveFactory = $rveFactory; 30 } 31 31 32 32 /** … … 42 42 throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 43 43 } 44 44 45 45 return $value; 46 46 } trunk/src/main/php/net/stubbles/ipo/request/filters/stubPasswordFilter.php
r151 r678 2 2 /** 3 3 * Class for filtering passwords. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 10 10 /** 11 11 * Class for filtering passwords. 12 * 13 * This filter allows to check password inputs and if they comply with the rules 12 * 13 * This filter allows to check password inputs and if they comply with the rules 14 14 * for a password. A minimum length validator can check the length of the password. 15 * Additionally its possible to check against a list of non-allowed passwords 15 * Additionally its possible to check against a list of non-allowed passwords 16 16 * (e.g. the username or the login name). The returned value is a md5- 17 17 * representation of the password. 18 18 * If the value is an array the fields with key 0 and 1 are compared. If they are 19 * not equal the password is not allowed (can be used to prevent mistyped 19 * not equal the password is not allowed (can be used to prevent mistyped 20 20 * passwords in register or password change forms). 21 21 * … … 38 38 */ 39 39 protected $nonAllowedValues = array(); 40 40 41 41 /** 42 42 * constructor 43 * 43 * 44 44 * @param stubRequestValueErrorFactory $rveFactory factory to create stubRequestValueErrors 45 45 * @param stubValidator $minLength validator to checking the minimum length 46 46 */ 47 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $minLength)48 {49 $this->rveFactory = $rveFactory;50 $this->minLength = $minLength;51 }52 53 /**54 * set a list of values that are not allowed as password55 *56 * @param array $values list of values that are not allowed as password57 */58 public function setNonAllowedValues(array $values)59 {60 $this->nonAllowedValues = $values;61 }47 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $minLength) 48 { 49 $this->rveFactory = $rveFactory; 50 $this->minLength = $minLength; 51 } 52 53 /** 54 * set a list of values that are not allowed as password 55 * 56 * @param array $values list of values that are not allowed as password 57 */ 58 public function setNonAllowedValues(array $values) 59 { 60 $this->nonAllowedValues = $values; 61 } 62 62 63 63 /** … … 74 74 throw new stubFilterException($this->rveFactory->create('PASSWORDS_NOT_EQUAL')); 75 75 } 76 76 77 77 $value = $value[0]; 78 78 } 79 79 80 80 if (false == $this->isRequired && strlen($value) == 0) { 81 81 return null; 82 82 } 83 83 84 84 if ($this->minLength->validate($value) == false) { 85 85 throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriteria())); 86 86 } 87 87 88 88 if (in_array($value, $this->nonAllowedValues) == true) { 89 89 throw new stubFilterException($this->rveFactory->create('PASSWORD_INVALID')); 90 90 } 91 91 92 92 return $this->secure($value); 93 93 } 94 94 95 95 /** 96 96 * turns input into a secure value … … 99 99 * @return string secure password 100 100 */ 101 protected function secure($password)102 {103 return md5($password);104 }101 protected function secure($password) 102 { 103 return md5($password); 104 } 105 105 } 106 106 ?> trunk/src/main/php/net/stubbles/ipo/request/filters/stubStringFilter.php
r151 r678 2 2 /** 3 3 * Class for filtering strings (singe line). 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 10 10 /** 11 11 * Class for filtering strings (singe line). 12 * 12 * 13 13 * This filter removes all line breaks. With a regex validator the contents of the 14 14 * string can be checked (applied after all line breaks have been removed). … … 26 26 */ 27 27 protected $regex; 28 28 29 29 /** 30 30 * constructor 31 * 31 * 32 32 * @param stubRequestValueErrorFactory $rveFactory factory to create RequestValueErrors 33 33 * @param stubValidator $regex validator to use for checking the string 34 34 */ 35 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $regex)36 {37 $this->rveFactory = $rveFactory;38 $this->regex = $regex;39 }35 public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $regex) 36 { 37 $this->rveFactory = $rveFactory; 38 $this->regex = $regex; 39 } 40 40 41 41 /** … … 48 48 protected function doExecute($value) 49 49 { 50 if (null != $value) {51 // remove line feeds, HTML and all added slashes from magic_gpc_quote52 $value = str_replace(chr(10), '', str_replace(chr(13), '', stripslashes($value)));53 $value = strip_tags($value);54 55 if ($this->regex->validate($value) == false) {56 throw new stubFilterException($this->rveFactory->create('FIELD_WRONG_VALUE'));57 }58 }59 50 if (null != $value) { 51 // remove line feeds, HTML and all added slashes from magic_gpc_quote 52 $value = str_replace(chr(10), '', str_replace(chr(13), '', stripslashes($value))); 53 $value = strip_tags($value); 54 55 if ($this->regex->validate($value) == false) { 56 throw new stubFilterException($this->rveFactory->create('FIELD_WRONG_VALUE')); 57 } 58 } 59 60 60 return $value; 61 61 } trunk/src/main/php/net/stubbles/ipo/request/filters/stubTextFilter.php
r151 r678 2 2 /** 3 3 * Class for filtering texts (strings containing line feeds). 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 28 28 */ 29 29 protected $allowedTags = array(); 30 30 31 31 /** 32 32 * constructor 33 * 33 * 34 34 * @param stubRequestValueErrorFactory $rveFactory factory to create RequestValueErrors 35 35 */ 36 public function __construct(stubRequestValueErrorFactory $rveFactory)37 {38 $this->rveFactory = $rveFactory;39 }40 41 /**42 * set the list of allowed tags43 * 44 * Use this option very careful. It does not protect you against36 public function __construct(stubRequestValueErrorFactory $rveFactory) 37 { 38 $this->rveFactory = $rveFactory; 39 } 40 41 /** 42 * set the list of allowed tags 43 * 44 * Use this option very careful. It does not protect you against 45 45 * possible XSS attacks! 46 *47 * @param array<string> $allowedTags48 */49 public function setAllowedTags(array $allowedTags)50 {51 $this->allowedTags = $allowedTags;52 }46 * 47 * @param array<string> $allowedTags 48 */ 49 public function setAllowedTags(array $allowedTags) 50 { 51 $this->allowedTags = $allowedTags; 52 } 53 53 54 54 /** … … 61 61 protected function doExecute($value) 62 62 { 63 if (null != $value) {64 // remove carriage return and all added slashes from magic_gpc_quote65 $value = str_replace(chr(13), '', stripslashes($value));66 $value = strip_tags($value, ((count($this->allowedTags) > 0) ? ('<' . join('><', $this->allowedTags) . '>') : ('')));67 }68 63 if (null != $value) { 64 // remove carriage return and all added slashes from magic_gpc_quote 65 $value = str_replace(chr(13), '', stripslashes($value)); 66 $value = strip_tags($value, ((count($this->allowedTags) > 0) ? ('<' . join('><', $this->allowedTags) . '>') : (''))); 67 } 68 69 69 return $value; 70 70 } trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableJoin.php
r482 r678 78 78 $types = explode(' ', $type); 79 79 foreach ($types as $typeTest) { 80 if (in_array($typeTest, self::$types) == false) {80 if (in_array($typeTest, self::$types) == false) { 81 81 throw new stubIllegalArgumentException('The given join type ' . $type . ' is not an allowed join type. Allowed join types are ' . join(', ', self::$types)); 82 82 } 83 83 } 84 84 85 85 $this->type = $type; 86 86 } … … 108 108 throw new stubIllegalArgumentException('The given join condition type ' . $conditionType . ' is not an allowed join type. Allowed join condition types are ' . join(', ', $conditionTypes)); 109 109 } 110 110 111 111 $this->conditionType = $conditionType; 112 112 } trunk/src/main/php/net/stubbles/reflection/annotations/parser/stubAnnotationStateParser.php
r491 r678 83 83 throw new ReflectionException('Unknown state ' . $state); 84 84 } 85 85 86 86 $this->currentState = $this->states[$state]; 87 87 $this->currentState->selected(); … … 106 106 $this->currentState->process($docBlock{$i}); 107 107 } 108 108 109 109 if (($this->currentState instanceof stubAnnotationDocblockState) == false 110 110 && ($this->currentState instanceof stubAnnotationTextState) == false) { 111 111 throw new ReflectionException('Annotation parser finished in wrong state, last annotation probably closed incorrectly, last state was ' . $this->currentState->getClassName()); 112 112 } 113 113 114 114 return $this->annotations; 115 115 } … … 148 148 throw new ReflectionException('Error parsing annotation ' . $this->currentAnnotation); 149 149 } 150 150 151 151 $this->annotations[$this->currentAnnotation]['params']['value'] = $value; 152 152 } … … 185 185 return (string) $value; 186 186 } 187 187 188 188 if ('true' === $value) { 189 189 return true; 190 190 } 191 191 192 192 if ('false' === $value) { 193 193 return false; 194 194 } 195 195 196 196 if ('null' === strtolower($value)) { 197 197 return null; 198 198 } 199 200 if (preg_match('/^[+-]?[0-9]+$/', $value) != false) { 199 200 if (preg_match('/^[+-]?[0-9]+$/', $value) != false) { 201 201 return (integer) $value; 202 202 } 203 204 if (preg_match('/^[+-]?[0-9]+\.[0-9]+$/', $value) != false) { 203 204 if (preg_match('/^[+-]?[0-9]+\.[0-9]+$/', $value) != false) { 205 205 return (double) $value; 206 206 } 207 207 208 208 $matches = array(); 209 209 if (preg_match('/^([a-zA-Z_]{1}[a-zA-Z\.0-9_]*)\.class/', $value, $matches) != false) { 210 210 return new stubReflectionClass($matches[1]); 211 211 } 212 212 213 213 if (defined($value) == true) { 214 214 return constant($value); 215 215 } 216 216 217 217 return (string) $value; 218 218 } trunk/src/main/php/net/stubbles/util/ext/stubXPClassLoader.php
r630 r678 59 59 $version = '0.0.0'; 60 60 foreach ($dir as $file) { 61 if (substr($file->getFilename(), 0, 6) != 'xp-rt-') {62 continue;63 }61 if (substr($file->getFilename(), 0, 6) != 'xp-rt-') { 62 continue; 63 } 64 64 65 $testVersion = str_replace('xp-rt-', '', str_replace('.xar', '', $file->getFilename()));66 if (version_compare($testVersion, $version, '>') == true) {67 $version = $testVersion;68 }65 $testVersion = str_replace('xp-rt-', '', str_replace('.xar', '', $file->getFilename())); 66 if (version_compare($testVersion, $version, '>') == true) { 67 $version = $testVersion; 68 } 69 69 } 70 70 trunk/src/main/php/net/stubbles/util/validators/stubMaxNumberValidator.php
r151 r678 2 2 /** 3 3 * Validator to ensure that a value is not greater than a given maximum value. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 22 22 */ 23 23 protected $maxValue; 24 24 25 25 /** 26 26 * constructor … … 32 32 $this->maxValue = $maxValue; 33 33 } 34 34 35 35 /** 36 36 * validate that the given value is smaller than or equal to the maximum value … … 41 41 public function validate($value) 42 42 { 43 if ($value > $this->maxValue) {44 return false;45 }46 47 return true;43 if ($value > $this->maxValue) { 44 return false; 45 } 46 47 return true; 48 48 } 49 49 50 50 /** 51 51 * returns a list of criteria for the validator 52 * 52 * 53 53 * <code> 54 54 * array('maxNumber' => [maximum_value]); trunk/src/main/php/net/stubbles/util/validators/stubMinLengthValidator.php
r151 r678 2 2 /** 3 3 * Validator to ensure that a string is not shorter than a given minimum length. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 22 22 */ 23 23 protected $minLength; 24 24 25 25 /** 26 26 * constructor … … 32 32 $this->minLength = $minLength; 33 33 } 34 34 35 35 /** 36 36 * validate that the given value is not shorter than the maximum length … … 41 41 public function validate($value) 42 42 { 43 if (strlen($value) < $this->minLength) {44 return false;45 }46 47 return true;43 if (strlen($value) < $this->minLength) { 44 return false; 45 } 46 47 return true; 48 48 } 49 49 50 50 /** 51 51 * returns a list of criteria for the validator trunk/src/main/php/net/stubbles/util/validators/stubMinNumberValidator.php
r151 r678 2 2 /** 3 3 * Validator to ensure that a value is not smaller than a given minimum value. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 22 22 */ 23 23 protected $minValue; 24 24 25 25 /** 26 26 * constructor … … 32 32 $this->minValue = $minValue; 33 33 } 34 34 35 35 /** 36 36 * validate that the given value is greater than or equal to the maximum value … … 41 41 public function validate($value) 42 42 { 43 if ($value < $this->minValue) {44 return false;45 }46 47 return true;43 if ($value < $this->minValue) { 44 return false; 45 } 46 47 return true; 48 48 } 49 49 50 50 /** 51 51 * returns a list of criteria for the validator trunk/src/main/php/net/stubbles/util/validators/stubPassThruValidator.php
r497 r678 24 24 public function validate($value) 25 25 { 26 return true;26 return true; 27 27 } 28 28 trunk/src/main/php/net/stubbles/util/validators/stubRegexValidator.php
r151 r678 2 2 /** 3 3 * Validator to ensure a value complies to a given regular expression. 4 * 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles … … 10 10
