Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 82fe180

Browse files
committed
Cleaning up a few method names.
1 parent d5d4f37 commit 82fe180

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/Illuminate/Validation/Validator.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,19 +314,31 @@ protected function validate($attribute, $rule)
314314
$this->addFailure($attribute, $rule, $parameters);
315315
}
316316
}
317-
317+
318318
/**
319-
* Returns the data which have been successfully validated
319+
* Returns the data which was valid.
320320
*
321321
* @return array
322322
*/
323-
public function passed()
323+
public function valid()
324324
{
325325
if ( ! $this->messages) $this->passes();
326-
326+
327327
return array_diff_key($this->data, $this->messages()->toArray());
328328
}
329329

330+
/**
331+
* Returns the data which was invalid.
332+
*
333+
* @return array
334+
*/
335+
public function invalid()
336+
{
337+
if ( ! $this->messages) $this->passes();
338+
339+
return array_intersect_key($this->data, $this->messages()->toArray());
340+
}
341+
330342
/**
331343
* Get the value of a given attribute.
332344
*

0 commit comments

Comments
 (0)