Skip to content

Commit

Permalink
Merge pull request #96 from ThHareau/master
Browse files Browse the repository at this point in the history
TypeError in arrayUnset
  • Loading branch information
emsifa authored Jul 10, 2019
2 parents eec567d + ace404e commit 76b4345
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static function arraySet(&$target, $key, $value, $overwrite = true): arra
* @param string|array $key
* @return mixed
*/
public static function arrayUnset(&$target, $key): array
public static function arrayUnset(&$target, $key)
{
if (!is_array($target)) {
return $target;
Expand Down
10 changes: 10 additions & 0 deletions tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,16 @@ public function testArrayAssocValidation()
$this->assertNull($errors->first('user.name:required'));
}

public function testEmptyArrayAssocValidation()
{
$validation = $this->validator->validate([], [
'user'=> 'required',
'user.email' => 'email',
]);

$this->assertFalse($validation->passes());
}

/**
* Test root asterisk validation.
*
Expand Down

0 comments on commit 76b4345

Please sign in to comment.