Skip to content

Commit

Permalink
add phpdocs, return type declarations on Rule class members
Browse files Browse the repository at this point in the history
  • Loading branch information
aautar committed Aug 11, 2024
1 parent fdc404c commit 0437f13
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions lib/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,44 @@

class Rule
{
/**
* @var string
*/
protected $id;

/**
* @var string
*/
protected $ruleCheckFailureMessage;

/**
* @var callable
*/
protected $ruleCheckFunction;

public function __construct($_id, $_ruleCheckFailureMessage, $_ruleCheckFunction)
/**
* @param string $_id Identifier for this rule
* @param string $_ruleCheckFailureMessage Message to surface when validation rule fails
* @param callable $_ruleCheckFunction Function to evaluate validation rule
*/
public function __construct(string $_id, string $_ruleCheckFailureMessage, callable $_ruleCheckFunction)
{
$this->id = $_id;
$this->ruleCheckFailureMessage = $_ruleCheckFailureMessage;
$this->ruleCheckFunction = $_ruleCheckFunction;
}

function getId()
function getId(): string
{
return $this->id;
}

function getRuleCheckFailureMessage()
function getRuleCheckFailureMessage(): string
{
return $this->ruleCheckFailureMessage;
}

function getRuleCheckFunction()
function getRuleCheckFunction(): callable
{
return $this->ruleCheckFunction;
}
Expand Down

0 comments on commit 0437f13

Please sign in to comment.