Skip to content

Commit

Permalink
🔨 new method isSet
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Mar 1, 2020
1 parent 30cd0f6 commit 12abe52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base/classes/helpers/ValidateHelper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public static function isNumeric($id,$method,$line)
}
}

public static function isSet($variable,$method,$line)
{
self::methodLine($method, $line, __METHOD__);
if( is_null($variable) ){
throw new InvalidArgumentException(TMessage::ERROR_TYPE_NOT_SET.'See the method: '.$method.' in the line: '.$line);
}
}

/**
* Validade is array and not empty
* @param array $array
Expand Down
1 change: 1 addition & 0 deletions base/classes/webform/TMessage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class TMessage {
const ERROR_EMPTY_INPUT = 'O Parametro não pode ficar em branco';
const ERROR_TYPE_NOT_INT = 'Tipo não númerico! ';
const ERROR_TYPE_NOT_ARRAY = 'Tipo não é um array! ';
const ERROR_TYPE_NOT_SET = 'A variable has not been defined! ';

public function __construct() {
}
Expand Down

0 comments on commit 12abe52

Please sign in to comment.