Skip to content

Commit

Permalink
Adds version v5.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Oct 14, 2018
1 parent 7714403 commit 419e1c7
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Application.php
Expand Up @@ -28,7 +28,7 @@ class Application extends Container implements ApplicationContract
*
* @var string
*/
const VERSION = '5.7.8';
const VERSION = '5.7.9';

/**
* The base path for the Laravel installation.
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
Expand Up @@ -18,7 +18,7 @@ trait AuthorizesRequests
*/
public function authorize($ability, $arguments = [])
{
list($ability, $arguments) = $this->parseAbilityAndArguments($ability, $arguments);
[$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments);

return app(Gate::class)->authorize($ability, $arguments);
}
Expand All @@ -35,7 +35,7 @@ public function authorize($ability, $arguments = [])
*/
public function authorizeForUser($user, $ability, $arguments = [])
{
list($ability, $arguments) = $this->parseAbilityAndArguments($ability, $arguments);
[$ability, $arguments] = $this->parseAbilityAndArguments($ability, $arguments);

return app(Gate::class)->forUser($user)->authorize($ability, $arguments);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ChannelMakeCommand.php
Expand Up @@ -37,7 +37,7 @@ protected function buildClass($name)
{
return str_replace(
'DummyUser',
class_basename(config('auth.providers.users.model')),
class_basename($this->userProviderModel()),
parent::buildClass($name)
);
}
Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Foundation/Console/PolicyMakeCommand.php
Expand Up @@ -54,13 +54,15 @@ protected function buildClass($name)
*/
protected function replaceUserNamespace($stub)
{
if (! config('auth.providers.users.model')) {
$model = $this->userProviderModel();

if (! $model) {
return $stub;
}

return str_replace(
$this->rootNamespace().'User',
config('auth.providers.users.model'),
$model,
$stub
);
}
Expand Down Expand Up @@ -90,7 +92,7 @@ protected function replaceModel($stub, $model)

$model = class_basename(trim($model, '\\'));

$dummyUser = class_basename(config('auth.providers.users.model'));
$dummyUser = class_basename($this->userProviderModel());

$dummyModel = Str::camel($model) === 'user' ? 'model' : $model;

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Console/PresetCommand.php
Expand Up @@ -12,7 +12,9 @@ class PresetCommand extends Command
*
* @var string
*/
protected $signature = 'preset { type : The preset type (none, bootstrap, vue, react) }';
protected $signature = 'preset
{ type : The preset type (none, bootstrap, vue, react) }
{ --option=* : Pass an option to the preset command }';

/**
* The console command description.
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/VendorPublishCommand.php
Expand Up @@ -90,7 +90,7 @@ protected function determineWhatShouldBePublished()
return;
}

list($this->provider, $this->tags) = [
[$this->provider, $this->tags] = [
$this->option('provider'), (array) $this->option('tag'),
];

Expand Down Expand Up @@ -140,7 +140,7 @@ protected function publishableChoices()
*/
protected function parseChoice($choice)
{
list($type, $value) = explode(': ', strip_tags($choice));
[$type, $value] = explode(': ', strip_tags($choice));

if ($type == 'Provider') {
$this->provider = $value;
Expand Down
11 changes: 11 additions & 0 deletions src/Illuminate/Foundation/Exceptions/views/401.blade.php
@@ -0,0 +1,11 @@
@extends('errors::illustrated-layout')

@section('code', '401')
@section('title', __('Unauthorized'))

@section('image')
<div style="background-image: url('/svg/403.svg');" class="absolute pin bg-cover bg-no-repeat md:bg-left lg:bg-center">
</div>
@endsection

@section('message', __('Sorry, you are not authorized to access this page.'))
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Exceptions/views/403.blade.php
@@ -1,11 +1,11 @@
@extends('errors::illustrated-layout')

@section('code', '403')
@section('title', __('Unauthorized'))
@section('title', __('Forbidden'))

@section('image')
<div style="background-image: url('/svg/403.svg');" class="absolute pin bg-cover bg-no-repeat md:bg-left lg:bg-center">
</div>
@endsection

@section('message', __('Sorry, you are not authorized to access this page.'))
@section('message', __('Sorry, you are forbidden to access this page.'))
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Http/Kernel.php
Expand Up @@ -210,7 +210,7 @@ protected function terminateMiddleware($request, $response)
continue;
}

list($name) = $this->parseMiddleware($middleware);
[$name] = $this->parseMiddleware($middleware);

$instance = $this->app->make($name);

Expand Down Expand Up @@ -243,7 +243,7 @@ protected function gatherRouteMiddleware($request)
*/
protected function parseMiddleware($middleware)
{
list($name, $parameters) = array_pad(explode(':', $middleware, 2), 2, []);
[$name, $parameters] = array_pad(explode(':', $middleware, 2), 2, []);

if (is_string($parameters)) {
$parameters = explode(',', $parameters);
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Inspiring.php
Expand Up @@ -32,6 +32,7 @@ public static function quote()
'Genius is one percent inspiration and ninety-nine percent perspiration. - Thomas Edison',
'Computer science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra',
'It always seems impossible until it is done. - Nelson Mandela',
'Act only according to that maxim whereby you can, at the same time, will that it should become a universal law. - Immanuel Kant',
])->random();
}
}
36 changes: 33 additions & 3 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Str;
use Illuminate\Support\Carbon;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Traits\Macroable;
use PHPUnit\Framework\Assert as PHPUnit;
use Symfony\Component\HttpFoundation\StreamedResponse;
Expand Down Expand Up @@ -743,6 +744,8 @@ public function assertViewHas($key, $value = null)
PHPUnit::assertArrayHasKey($key, $this->original->getData());
} elseif ($value instanceof Closure) {
PHPUnit::assertTrue($value($this->original->$key));
} elseif ($value instanceof Model) {
PHPUnit::assertTrue($value->is($this->original->$key));
} else {
PHPUnit::assertEquals($value, $this->original->$key);
}
Expand Down Expand Up @@ -883,17 +886,44 @@ public function assertSessionHasErrors($keys = [], $format = null, $errorBag = '
}

/**
* Assert that the session has no errors.
* Assert that the session is missing the given errors.
*
* @param string|array $keys
* @param string $format
* @param string $errorBag
* @return $this
*/
public function assertSessionHasNoErrors()
public function assertSessionDoesntHaveErrors($keys = [], $format = null, $errorBag = 'default')
{
$this->assertSessionMissing('errors');
$keys = (array) $keys;

if (empty($keys)) {
return $this->assertSessionMissing('errors');
}

$errors = $this->session()->get('errors')->getBag($errorBag);

foreach ($keys as $key => $value) {
if (is_int($key)) {
PHPUnit::assertFalse($errors->has($value), "Session has unexpected error: $value");
} else {
PHPUnit::assertNotContains($value, $errors->get($key, $format));
}
}

return $this;
}

/**
* Assert that the session has no errors.
*
* @return $this
*/
public function assertSessionHasNoErrors()
{
return $this->assertSessionMissing('errors');
}

/**
* Assert that the session has the given errors.
*
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Foundation/Validation/ValidatesRequests.php
Expand Up @@ -14,6 +14,8 @@ trait ValidatesRequests
* @param \Illuminate\Contracts\Validation\Validator|array $validator
* @param \Illuminate\Http\Request|null $request
* @return array
*
* @throws \Illuminate\Validation\ValidationException
*/
public function validateWith($validator, Request $request = null)
{
Expand All @@ -34,6 +36,8 @@ public function validateWith($validator, Request $request = null)
* @param array $messages
* @param array $customAttributes
* @return array
*
* @throws \Illuminate\Validation\ValidationException
*/
public function validate(Request $request, array $rules,
array $messages = [], array $customAttributes = [])
Expand Down

0 comments on commit 419e1c7

Please sign in to comment.