Skip to content

Commit 1801899

Browse files
committed
method to get first error
1 parent 8c785ef commit 1801899

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/PHPixie/Validate/Results/Result.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ public function errors()
196196
{
197197
return $this->errors;
198198
}
199+
200+
public function firstError()
201+
{
202+
if(!isset($this->errors[0])) {
203+
return null;
204+
}
205+
206+
return $this->errors[0];
207+
}
199208

200209
/**
201210
* @return mixed

0 commit comments

Comments
 (0)