Skip to content

Commit 8082d4b

Browse files
Merge branch '7.x'
2 parents 01ec8f2 + 85fbe6d commit 8082d4b

File tree

15 files changed

+85
-4
lines changed

15 files changed

+85
-4
lines changed

src/Illuminate/Cache/DynamoDbStore.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ public function putMany(array $values, $seconds)
253253
* @param mixed $value
254254
* @param int $seconds
255255
* @return bool
256+
*
257+
* @throws \Aws\DynamoDb\Exception\DynamoDbException
256258
*/
257259
public function add($key, $value, $seconds)
258260
{
@@ -298,6 +300,8 @@ public function add($key, $value, $seconds)
298300
* @param string $key
299301
* @param mixed $value
300302
* @return int|bool
303+
*
304+
* @throws \Aws\DynamoDb\Exception\DynamoDbException
301305
*/
302306
public function increment($key, $value = 1)
303307
{
@@ -343,6 +347,8 @@ public function increment($key, $value = 1)
343347
* @param string $key
344348
* @param mixed $value
345349
* @return int|bool
350+
*
351+
* @throws \Aws\DynamoDb\Exception\DynamoDbException
346352
*/
347353
public function decrement($key, $value = 1)
348354
{

src/Illuminate/Database/Connectors/ConnectionFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ protected function createPdoResolver(array $config)
171171
*
172172
* @param array $config
173173
* @return \Closure
174+
*
175+
* @throws \PDOException
174176
*/
175177
protected function createPdoResolverWithHosts(array $config)
176178
{

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ protected function addCastAttributesToArray(array $attributes, array $mutatedAtt
234234
$attributes[$key] = $attributes[$key]->format(explode(':', $value, 2)[1]);
235235
}
236236

237+
if ($attributes[$key] && $attributes[$key] instanceof DateTimeInterface &&
238+
$this->isClassCastable($key)) {
239+
$attributes[$key] = $this->serializeDate($attributes[$key]);
240+
}
241+
237242
if ($attributes[$key] instanceof Arrayable) {
238243
$attributes[$key] = $attributes[$key]->toArray();
239244
}

src/Illuminate/Database/Eloquent/Relations/MorphToMany.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery,
115115
);
116116
}
117117

118+
/**
119+
* Get the pivot models that are currently attached.
120+
*
121+
* @return \Illuminate\Support\Collection
122+
*/
123+
protected function getCurrentlyAttachedPivots()
124+
{
125+
return parent::getCurrentlyAttachedPivots()->map(function ($record) {
126+
return $record->setMorphType($this->morphType)
127+
->setMorphClass($this->morphClass);
128+
});
129+
}
130+
118131
/**
119132
* Create a new query builder for the pivot table.
120133
*

src/Illuminate/Database/Eloquent/SoftDeletes.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function trashed()
137137
}
138138

139139
/**
140-
* Register a restoring model event with the dispatcher.
140+
* Register a "restoring" model event callback with the dispatcher.
141141
*
142142
* @param \Closure|string $callback
143143
* @return void
@@ -148,7 +148,7 @@ public static function restoring($callback)
148148
}
149149

150150
/**
151-
* Register a restored model event with the dispatcher.
151+
* Register a "restored" model event callback with the dispatcher.
152152
*
153153
* @param \Closure|string $callback
154154
* @return void
@@ -158,6 +158,17 @@ public static function restored($callback)
158158
static::registerModelEvent('restored', $callback);
159159
}
160160

161+
/**
162+
* Register a "forceDeleted" model event callback with the dispatcher.
163+
*
164+
* @param \Closure|string $callback
165+
* @return void
166+
*/
167+
public static function forceDeleted($callback)
168+
{
169+
static::registerModelEvent('forceDeleted', $callback);
170+
}
171+
161172
/**
162173
* Determine if the model is currently force deleting.
163174
*

src/Illuminate/Database/Query/Processors/PostgresProcessor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ class PostgresProcessor extends Processor
1717
*/
1818
public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)
1919
{
20-
$result = $query->getConnection()->selectFromWriteConnection($sql, $values)[0];
20+
$connection = $query->getConnection();
21+
22+
$connection->recordsHaveBeenModified();
23+
24+
$result = $connection->selectFromWriteConnection($sql, $values)[0];
2125

2226
$sequence = $sequence ?: 'id';
2327

src/Illuminate/Foundation/Console/RouteListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ protected function getMiddleware($route)
172172
{
173173
return collect($this->router->gatherRouteMiddleware($route))->map(function ($middleware) {
174174
return $middleware instanceof Closure ? 'Closure' : $middleware;
175-
})->implode(',');
175+
})->implode("\n");
176176
}
177177

178178
/**

src/Illuminate/Foundation/Providers/FoundationServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function register()
4949
* Register the "validate" macro on the request.
5050
*
5151
* @return void
52+
*
53+
* @throws \Illuminate\Validation\ValidationException
5254
*/
5355
public function registerRequestValidation()
5456
{

src/Illuminate/Foundation/Testing/TestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ protected function setUpTraits()
143143
* Clean up the testing environment before the next test.
144144
*
145145
* @return void
146+
*
147+
* @throws \Mockery\Exception\InvalidCountException
146148
*/
147149
protected function tearDown(): void
148150
{

src/Illuminate/Queue/Worker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ protected function handleJobException($connectionName, $job, WorkerOptions $opti
446446
* @param \Illuminate\Contracts\Queue\Job $job
447447
* @param int $maxTries
448448
* @return void
449+
*
450+
* @throws \Throwable
449451
*/
450452
protected function markJobAsFailedIfAlreadyExceedsMaxAttempts($connectionName, $job, $maxTries)
451453
{

0 commit comments

Comments
 (0)