We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fff2e19 commit 701b27fCopy full SHA for 701b27f
src/ValidatorTrait.php
@@ -125,15 +125,14 @@ public function beforeValidate(){}
125
*/
126
public function validate(array $onlyChecked = [],$hasErrorStop=null)
127
{
128
- if ( $this->_hasValidated ) {
129
- return $this;
130
- }
131
-
132
if ( !property_exists($this, 'data') ) {
133
throw new \InvalidArgumentException('Must be defined property \'data (array)\' in the classes used.');
134
}
135
136
- $data = $this->data;
+ if ( $this->_hasValidated || !($data = $this->data) ) {
+ return $this;
+ }
+
137
$this->beforeValidate();
138
$this->clearErrors();
139
$this->hasErrorStop($hasErrorStop);
0 commit comments