Skip to content

Commit 8bc1e77

Browse files
committed
Merge branch '9.x'
# Conflicts: # .github/workflows/tests.yml # CHANGELOG.md # src/Illuminate/Collections/Collection.php # src/Illuminate/Foundation/Application.php # src/Illuminate/Support/Stringable.php
2 parents 95dcf0d + a155ccd commit 8bc1e77

File tree

60 files changed

+1153
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1153
-153
lines changed

.github/workflows/databases.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: databases
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
49

510
jobs:
611
mysql_57:

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: static analysis
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- '*.x'
58
pull_request:
6-
schedule:
7-
- cron: '0 0 * * *'
89

910
jobs:
1011
src:

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: tests
22

33
on:
44
push:
5+
branches:
6+
- master
7+
- '*.x'
58
pull_request:
69
schedule:
710
- cron: '0 0 * * *'
@@ -38,6 +41,9 @@ jobs:
3841
matrix:
3942
php: [8.1]
4043
stability: [prefer-lowest, prefer-stable]
44+
include:
45+
- php: 8.2
46+
stability: prefer-stable --ignore-platform-req=php+
4147

4248
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
4349

@@ -98,6 +104,9 @@ jobs:
98104
matrix:
99105
php: [8.1]
100106
stability: [prefer-lowest, prefer-stable]
107+
include:
108+
- php: 8.2
109+
stability: prefer-stable --ignore-platform-req=php+
101110

102111
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows
103112

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@
8181
"illuminate/view": "self.version"
8282
},
8383
"require-dev": {
84+
"ably/ably-php": "^1.0",
8485
"aws/aws-sdk-php": "^3.198.1",
8586
"doctrine/dbal": "^2.13.3|^3.1.4",
8687
"fakerphp/faker": "^1.9.2",
8788
"guzzlehttp/guzzle": "^7.2",
8889
"league/flysystem-aws-s3-v3": "^3.0",
8990
"league/flysystem-ftp": "^3.0",
91+
"league/flysystem-read-only": "^3.3",
9092
"league/flysystem-sftp-v3": "^3.0",
9193
"mockery/mockery": "^1.4.4",
9294
"orchestra/testbench-core": "^8.0",
@@ -150,6 +152,7 @@
150152
"laravel/tinker": "Required to use the tinker console command (^2.0).",
151153
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).",
152154
"league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
155+
"league/flysystem-read-only": "Required to use read-only disks (^3.3)",
153156
"league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
154157
"mockery/mockery": "Required to use mocking (^1.4.4).",
155158
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",

src/Illuminate/Auth/SessionGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
5858
*
5959
* @var int
6060
*/
61-
protected $rememberDuration = 2628000;
61+
protected $rememberDuration = 576000;
6262

6363
/**
6464
* The session used by the guard.

src/Illuminate/Collections/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ public function put($key, $value)
974974
/**
975975
* Get one or a specified number of items randomly from the collection.
976976
*
977-
* @param (callable(TValue): int)|int|null $number
977+
* @param (callable(self<TKey, TValue>): int)|int|null $number
978978
* @param bool $preserveKeys
979979
* @return static<int, TValue>|TValue
980980
*

src/Illuminate/Collections/LazyCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public function except($keys)
398398
/**
399399
* Run a filter over each of the items.
400400
*
401-
* @param (callable(TValue): bool)|null $callback
401+
* @param (callable(TValue, TKey): bool)|null $callback
402402
* @return static
403403
*/
404404
public function filter(callable $callback = null)

src/Illuminate/Console/GeneratorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ protected function replaceClass($stub, $name)
355355
*/
356356
protected function sortImports($stub)
357357
{
358-
if (preg_match('/(?P<imports>(?:use [^;{]+;$\n?)+)/m', $stub, $match)) {
358+
if (preg_match('/(?P<imports>(?:^use [^;{]+;$\n?)+)/m', $stub, $match)) {
359359
$imports = explode("\n", trim($match['imports']));
360360

361361
sort($imports);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,18 @@ public function isClean($attributes = null)
18871887
return ! $this->isDirty(...func_get_args());
18881888
}
18891889

1890+
/**
1891+
* Discard attribute changes and reset the attributes to their original state.
1892+
*
1893+
* @return $this
1894+
*/
1895+
public function discardChanges()
1896+
{
1897+
[$this->attributes, $this->changes] = [$this->original, []];
1898+
1899+
return $this;
1900+
}
1901+
18901902
/**
18911903
* Determine if the model or any of the given attribute(s) were changed when the model was last saved.
18921904
*

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,9 @@ public function fill(array $attributes)
441441
{
442442
$totallyGuarded = $this->totallyGuarded();
443443

444-
foreach ($this->fillableFromArray($attributes) as $key => $value) {
444+
$fillable = $this->fillableFromArray($attributes);
445+
446+
foreach ($fillable as $key => $value) {
445447
// The developers may choose to place some attributes in the "fillable" array
446448
// which means only those attributes may be set through mass assignment to
447449
// the model, and all others will just get ignored for security reasons.
@@ -455,6 +457,14 @@ public function fill(array $attributes)
455457
}
456458
}
457459

460+
if (count($attributes) !== count($fillable) &&
461+
static::preventsSilentlyDiscardingAttributes()) {
462+
throw new MassAssignmentException(sprintf(
463+
'Add fillable property to allow mass assignment on [%s].',
464+
get_class($this)
465+
));
466+
}
467+
458468
return $this;
459469
}
460470

0 commit comments

Comments
 (0)