Skip to content

Commit 41b59e0

Browse files
committed
fix conflicts
2 parents 0095ead + 94a54fc commit 41b59e0

32 files changed

+581
-45
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ matrix:
1313
- php: 7.2
1414
- php: 7.2
1515
env: setup=lowest
16+
- php: 7.3
17+
- php: 7.3
18+
env: setup=lowest
1619

1720
sudo: false
1821

CHANGELOG-5.7.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Release Notes for 5.7.x
22

3+
## Unreleased
4+
5+
### Added
6+
- Added ability to return an array of messages in a custom validation rule ([#26327](https://github.com/laravel/framework/pull/26327))
7+
- Added `whenEmpty`/ `whenNotEmpty` / `unlessEmpty` / `unlessNotEmpty` methods to `Collection` ([#26345](https://github.com/laravel/framework/pull/26345))
8+
- Added `Illuminate\Cache\Repository::missing` method ([#26351](https://github.com/laravel/framework/pull/26351))
9+
- Added `Macroable` trait to `Illuminate\View\Factory` ([#26361](https://github.com/laravel/framework/pull/26361))
10+
11+
### Changed
12+
- Updated `AbstractPaginator::appends` to handle null ([#26326](https://github.com/laravel/framework/pull/26326))
13+
- Added "guzzlehttp/guzzle": "^6.3", to `composer.json` ([#26328](https://github.com/laravel/framework/pull/26328))
14+
- Showed exception message on 403 error page when message is available ([#26356](https://github.com/laravel/framework/pull/26356))
15+
- Don't run TransformsRequest twice on ?query= parameters ([#26366](https://github.com/laravel/framework/pull/26366))
16+
- Added missing logging options to slack log driver ([#26360](https://github.com/laravel/framework/pull/26360))
17+
18+
### Changed realization
19+
- Used `Request::validate` macro in Auth traits ([#26314](https://github.com/laravel/framework/pull/26314))
20+
21+
322
## [v5.7.12 (2018-10-30)](https://github.com/laravel/framework/compare/v5.7.11...v5.7.12)
423

524
### Added

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"aws/aws-sdk-php": "^3.0",
7979
"doctrine/dbal": "^2.6",
8080
"filp/whoops": "^2.1.4",
81+
"guzzlehttp/guzzle": "^6.3",
8182
"league/flysystem-cached-adapter": "^1.0",
8283
"mockery/mockery": "^1.0",
8384
"moontoast/math": "^1.1",

src/Illuminate/Cache/Console/ClearCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(CacheManager $cache, Filesystem $files)
6060
*/
6161
public function handle()
6262
{
63-
$this->laravel['events']->fire(
63+
$this->laravel['events']->dispatch(
6464
'cache:clearing', [$this->argument('store'), $this->tags()]
6565
);
6666

@@ -72,7 +72,7 @@ public function handle()
7272
return $this->error('Failed to clear cache. Make sure you have the appropriate permissions.');
7373
}
7474

75-
$this->laravel['events']->fire(
75+
$this->laravel['events']->dispatch(
7676
'cache:cleared', [$this->argument('store'), $this->tags()]
7777
);
7878

src/Illuminate/Cache/Repository.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ public function has($key)
7070
return ! is_null($this->get($key));
7171
}
7272

73+
/**
74+
* Determine if an item doesn't exist in the cache.
75+
*
76+
* @param string $key
77+
* @return bool
78+
*/
79+
public function missing($key)
80+
{
81+
return ! $this->has($key);
82+
}
83+
7384
/**
7485
* Retrieve an item from the cache by key.
7586
*
@@ -308,7 +319,7 @@ public function forever($key, $value)
308319
}
309320

310321
/**
311-
* Get an item from the cache, or store the default value.
322+
* Get an item from the cache, or execute the given Closure and store the result.
312323
*
313324
* @param string $key
314325
* @param \DateTimeInterface|\DateInterval|float|int $minutes
@@ -332,9 +343,9 @@ public function remember($key, $minutes, Closure $callback)
332343
}
333344

334345
/**
335-
* Get an item from the cache, or store the default value forever.
346+
* Get an item from the cache, or execute the given Closure and store the result forever.
336347
*
337-
* @param string $key
348+
* @param string $key
338349
* @param \Closure $callback
339350
* @return mixed
340351
*/
@@ -344,9 +355,9 @@ public function sear($key, Closure $callback)
344355
}
345356

346357
/**
347-
* Get an item from the cache, or store the default value forever.
358+
* Get an item from the cache, or execute the given Closure and store the result forever.
348359
*
349-
* @param string $key
360+
* @param string $key
350361
* @param \Closure $callback
351362
* @return mixed
352363
*/

src/Illuminate/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ public function run(InputInterface $input = null, OutputInterface $output = null
8181
$input = $input ?: new ArgvInput
8282
);
8383

84-
$this->events->fire(
84+
$this->events->dispatch(
8585
new Events\CommandStarting(
8686
$commandName, $input, $output = $output ?: new ConsoleOutput
8787
)
8888
);
8989

9090
$exitCode = parent::run($input, $output);
9191

92-
$this->events->fire(
92+
$this->events->dispatch(
9393
new Events\CommandFinished($commandName, $input, $output, $exitCode)
9494
);
9595

src/Illuminate/Contracts/Cache/Repository.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function decrement($key, $value = 1);
8181
public function forever($key, $value);
8282

8383
/**
84-
* Get an item from the cache, or store the default value.
84+
* Get an item from the cache, or execute the given Closure and store the result.
8585
*
8686
* @param string $key
8787
* @param \DateTimeInterface|\DateInterval|float|int $minutes
@@ -91,18 +91,18 @@ public function forever($key, $value);
9191
public function remember($key, $minutes, Closure $callback);
9292

9393
/**
94-
* Get an item from the cache, or store the default value forever.
94+
* Get an item from the cache, or execute the given Closure and store the result forever.
9595
*
96-
* @param string $key
96+
* @param string $key
9797
* @param \Closure $callback
9898
* @return mixed
9999
*/
100100
public function sear($key, Closure $callback);
101101

102102
/**
103-
* Get an item from the cache, or store the default value forever.
103+
* Get an item from the cache, or execute the given Closure and store the result forever.
104104
*
105-
* @param string $key
105+
* @param string $key
106106
* @param \Closure $callback
107107
* @return mixed
108108
*/

src/Illuminate/Contracts/Validation/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function passes($attribute, $value);
1616
/**
1717
* Get the validation error message.
1818
*
19-
* @return string
19+
* @return string|array
2020
*/
2121
public function message();
2222
}

src/Illuminate/Database/Query/Grammars/Grammar.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class Grammar extends BaseGrammar
4646
*/
4747
public function compileSelect(Builder $query)
4848
{
49+
if ($query->unions && $query->aggregate) {
50+
return $this->compileUnionAggregate($query);
51+
}
52+
4953
// If the query does not have any columns set, we'll set the columns to the
5054
// * character to just get all of the columns from the database. Then we
5155
// can build the query and concatenate all the pieces together as one.
@@ -711,6 +715,21 @@ protected function compileUnion(array $union)
711715
return $conjunction.$union['query']->toSql();
712716
}
713717

718+
/**
719+
* Compile a union aggregate query into SQL.
720+
*
721+
* @param \Illuminate\Database\Query\Builder $query
722+
* @return string
723+
*/
724+
protected function compileUnionAggregate(Builder $query)
725+
{
726+
$sql = $this->compileAggregate($query, $query->aggregate);
727+
728+
$query->aggregate = null;
729+
730+
return $sql.' from ('.$this->compileSelect($query).') as '.$this->wrapTable('temp_table');
731+
}
732+
714733
/**
715734
* Compile an exists statement into SQL.
716735
*

src/Illuminate/Database/Query/Grammars/MySqlGrammar.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class MySqlGrammar extends Grammar
4242
*/
4343
public function compileSelect(Builder $query)
4444
{
45+
if ($query->unions && $query->aggregate) {
46+
return $this->compileUnionAggregate($query);
47+
}
48+
4549
$sql = parent::compileSelect($query);
4650

4751
if ($query->unions) {

src/Illuminate/Database/Query/Grammars/PostgresGrammar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ protected function compileDeleteWithJoins($query, $table)
363363
*/
364364
public function compileTruncate(Builder $query)
365365
{
366-
return ['truncate '.$this->wrapTable($query->from).' restart identity' => []];
366+
return ['truncate '.$this->wrapTable($query->from).' restart identity cascade' => []];
367367
}
368368

369369
/**

src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class SQLiteGrammar extends Grammar
4646
*/
4747
public function compileSelect(Builder $query)
4848
{
49+
if ($query->unions && $query->aggregate) {
50+
return $this->compileUnionAggregate($query);
51+
}
52+
4953
$sql = parent::compileSelect($query);
5054

5155
if ($query->unions) {

src/Illuminate/Database/Schema/ColumnDefinition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @method ColumnDefinition collation(string $collation) Specify a collation for the column (MySQL/SQL Server)
1313
* @method ColumnDefinition comment(string $comment) Add a comment to the column (MySQL)
1414
* @method ColumnDefinition default(mixed $value) Specify a "default" value for the column
15-
* @method ColumnDefinition first(string $column) Place the column "first" in the table (MySQL)
15+
* @method ColumnDefinition first() Place the column "first" in the table (MySQL)
1616
* @method ColumnDefinition nullable($value = true) Allow NULL values to be inserted into the column
1717
* @method ColumnDefinition storedAs($expression) Create a stored generated column (MySQL)
1818
* @method ColumnDefinition unique() Add a unique index
@@ -22,6 +22,7 @@
2222
* @method ColumnDefinition generatedAs($expression) Create a SQL compliant identity column (PostgreSQL)
2323
* @method ColumnDefinition always() Used as a modifier for generatedAs() (PostgreSQL)
2424
* @method ColumnDefinition index() Add an index
25+
* @method ColumnDefinition change() Change the column
2526
*/
2627
class ColumnDefinition extends Fluent
2728
{

src/Illuminate/Foundation/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ public function bootstrapWith(array $bootstrappers)
200200
$this->hasBeenBootstrapped = true;
201201

202202
foreach ($bootstrappers as $bootstrapper) {
203-
$this['events']->fire('bootstrapping: '.$bootstrapper, [$this]);
203+
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
204204

205205
$this->make($bootstrapper)->bootstrap($this);
206206

207-
$this['events']->fire('bootstrapped: '.$bootstrapper, [$this]);
207+
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
208208
}
209209
}
210210

src/Illuminate/Foundation/Exceptions/views/403.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
</div>
99
@endsection
1010

11-
@section('message', __('Sorry, you are forbidden from accessing this page.'))
11+
@section('message', __($exception->getMessage() ?: 'Sorry, you are forbidden from accessing this page.'))

src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function clean($request)
4343

4444
if ($request->isJson()) {
4545
$this->cleanParameterBag($request->json());
46-
} else {
46+
} elseif ($request->request !== $request->query) {
4747
$this->cleanParameterBag($request->request);
4848
}
4949
}

src/Illuminate/Log/LogManager.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ protected function createSlackDriver(array $config)
270270
$config['emoji'] ?? ':boom:',
271271
$config['short'] ?? false,
272272
$config['context'] ?? true,
273-
$this->level($config)
274-
)),
273+
$this->level($config),
274+
$config['bubble'] ?? true,
275+
$config['exclude_fields'] ?? []
276+
), $config),
275277
]);
276278
}
277279

src/Illuminate/Queue/Jobs/RedisJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function getJobId()
120120
/**
121121
* Get the underlying Redis factory implementation.
122122
*
123-
* @return \Illuminate\Contracts\Redis\Factory
123+
* @return \Illuminate\Queue\RedisQueue
124124
*/
125125
public function getRedisQueue()
126126
{

src/Illuminate/Support/Collection.php

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
5858
protected static $proxies = [
5959
'average', 'avg', 'contains', 'each', 'every', 'filter', 'first',
6060
'flatMap', 'groupBy', 'keyBy', 'map', 'max', 'min', 'partition',
61-
'reject', 'sortBy', 'sortByDesc', 'sum', 'unique',
61+
'reject', 'some', 'sortBy', 'sortByDesc', 'sum', 'unique',
6262
];
6363

6464
/**
@@ -238,6 +238,19 @@ public function collapse()
238238
return new static(Arr::collapse($this->items));
239239
}
240240

241+
/**
242+
* Alias for the "contains" method.
243+
*
244+
* @param mixed $key
245+
* @param mixed $operator
246+
* @param mixed $value
247+
* @return bool
248+
*/
249+
public function some($key, $operator = null, $value = null)
250+
{
251+
return $this->contains($key, $operator, $value);
252+
}
253+
241254
/**
242255
* Determine if an item exists in the collection.
243256
*
@@ -501,6 +514,32 @@ public function when($value, callable $callback, callable $default = null)
501514
return $this;
502515
}
503516

517+
/**
518+
* Apply the callback if the collection is empty.
519+
*
520+
* @param bool $value
521+
* @param callable $callback
522+
* @param callable $default
523+
* @return static|mixed
524+
*/
525+
public function whenEmpty(callable $callback, callable $default = null)
526+
{
527+
return $this->when($this->isEmpty(), $callback, $default);
528+
}
529+
530+
/**
531+
* Apply the callback if the collection is not empty.
532+
*
533+
* @param bool $value
534+
* @param callable $callback
535+
* @param callable $default
536+
* @return static|mixed
537+
*/
538+
public function whenNotEmpty(callable $callback, callable $default = null)
539+
{
540+
return $this->when($this->isNotEmpty(), $callback, $default);
541+
}
542+
504543
/**
505544
* Apply the callback if the value is falsy.
506545
*
@@ -514,6 +553,32 @@ public function unless($value, callable $callback, callable $default = null)
514553
return $this->when(! $value, $callback, $default);
515554
}
516555

556+
/**
557+
* Apply the callback unless the collection is empty.
558+
*
559+
* @param bool $value
560+
* @param callable $callback
561+
* @param callable $default
562+
* @return static|mixed
563+
*/
564+
public function unlessEmpty(callable $callback, callable $default = null)
565+
{
566+
return $this->unless($this->isEmpty(), $callback, $default);
567+
}
568+
569+
/**
570+
* Apply the callback unless the collection is not empty.
571+
*
572+
* @param bool $value
573+
* @param callable $callback
574+
* @param callable $default
575+
* @return static|mixed
576+
*/
577+
public function unlessNotEmpty(callable $callback, callable $default = null)
578+
{
579+
return $this->unless($this->isNotEmpty(), $callback, $default);
580+
}
581+
517582
/**
518583
* Filter items by the given key value pair.
519584
*

0 commit comments

Comments
 (0)