Skip to content

Commit

Permalink
Merge branch '5.6' of github.com:laravel/framework into 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 8, 2018
2 parents cc7ad5f + 4d31633 commit 5638538
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Log/LogManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ protected function createSingleDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(
new StreamHandler($config['path'], $this->level($config))
new StreamHandler(
$config['path'], $this->level($config),
$config['bubble'] ?? true, $config['permission'] ?? null, $config['locking'] ?? false
)
),
]);
}
Expand All @@ -258,7 +261,8 @@ protected function createDailyDriver(array $config)
{
return new Monolog($this->parseChannel($config), [
$this->prepareHandler(new RotatingFileHandler(
$config['path'], $config['days'] ?? 7, $this->level($config)
$config['path'], $config['days'] ?? 7, $this->level($config),
$config['bubble'] ?? true, $config['permission'] ?? null, $config['locking'] ?? false
)),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function validate()

return $data->only(collect($this->getRules())->keys()->map(function ($rule) {
return Str::contains($rule, '.') ? explode('.', $rule)[0] : $rule;
}))->unique()->toArray();
})->unique())->toArray();
}

/**
Expand Down
9 changes: 6 additions & 3 deletions tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3876,12 +3876,15 @@ public function message()

public function testValidateReturnsValidatedData()
{
$post = ['first' => 'john', 'last' => 'doe', 'type' => 'admin'];
$post = ['first' => 'john', 'preferred'=>'john', 'last' => 'doe', 'type' => 'admin'];

$v = new Validator($this->getIlluminateArrayTranslator(), $post, ['first' => 'required']);
$v = new Validator($this->getIlluminateArrayTranslator(), $post, ['first' => 'required', 'preferred'=> 'required']);
$v->sometimes('type', 'required', function () {
return false;
});
$data = $v->validate();

$this->assertEquals(['first' => 'john'], $data);
$this->assertEquals(['first' => 'john', 'preferred' => 'john'], $data);
}

protected function getTranslator()
Expand Down

0 comments on commit 5638538

Please sign in to comment.