This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Rules { | |
// Sets all of the rules to check a given field | |
public $ruleParameters = ['isRequired', 'maxLenght', 'minLength', 'atLeastOne']; | |
// Creates all of the specific parameters for the rules | |
public function __construct($parameters){ | |
foreach($parameters as $parameter => $value) $this->ruleParameters[$parameter] = $value; | |
} | |
// Checks if a string follows all of the parameters | |
public function checkRules($string) { |