Skip to content

Commit

Permalink
Merge branch '10.x'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/tests.yml
#	CHANGELOG.md
#	src/Illuminate/Foundation/Application.php
  • Loading branch information
driesvints committed Mar 4, 2024
2 parents 107a19b + 119a3a3 commit 7de4d1e
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/facades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/queues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev

- name: Set minimum PHP 8.2 versions
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand All @@ -78,7 +78,7 @@ jobs:
command: composer require phpunit/phpunit:^${{ matrix.phpunit }} --dev --no-interaction --no-update

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
coverage: none

- name: Set Minimum PHP 8.2 Versions
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand All @@ -148,7 +148,7 @@ jobs:
command: composer require phpunit/phpunit:~${{ matrix.phpunit }} --dev --no-interaction --no-update

- name: Install dependencies
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/Console/PruneStaleTagsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PruneStaleTagsCommand extends Command
* Execute the console command.
*
* @param \Illuminate\Cache\CacheManager $cache
* @return void
* @return int|null
*/
public function handle(CacheManager $cache)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Database\Eloquent\Relations\Concerns;

use BackedEnum;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Pivot;
Expand Down Expand Up @@ -154,6 +155,10 @@ protected function formatRecordsList(array $records)
[$id, $attributes] = [$attributes, []];
}

if ($id instanceof BackedEnum) {
$id = $id->value;
}

return [$id => $attributes];
})->all();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ protected function compileDeleteWithJoinsOrLimit(Builder $query)
public function compileTruncate(Builder $query)
{
return [
'delete from sqlite_sequence where name = ?' => [$query->from],
'delete from sqlite_sequence where name = ?' => [$this->getTablePrefix().$query->from],
'delete from '.$this->wrapTable($query->from) => [],
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/resources/views/text/header.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{{ $slot }}]({{ $url }})
{{ $slot }}: {{ $url }}
6 changes: 3 additions & 3 deletions src/Illuminate/Support/Facades/Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class Facade
/**
* The application instance being facaded.
*
* @var \Illuminate\Contracts\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application|null
*/
protected static $app;

Expand Down Expand Up @@ -318,7 +318,7 @@ public static function defaultAliases()
/**
* Get the application instance behind the facade.
*
* @return \Illuminate\Contracts\Foundation\Application
* @return \Illuminate\Contracts\Foundation\Application|null
*/
public static function getFacadeApplication()
{
Expand All @@ -328,7 +328,7 @@ public static function getFacadeApplication()
/**
* Set the application instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application|null $app
* @return void
*/
public static function setFacadeApplication($app)
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ public static function headline($value)
*/
public static function apa($value)
{
if ($value === '') {
if (trim($value) === '') {
return $value;
}

Expand Down Expand Up @@ -1645,7 +1645,7 @@ public static function uuid()
}

/**
* Generate a time-ordered UUID (version 4).
* Generate a time-ordered UUID.
*
* @return \Ramsey\Uuid\UuidInterface
*/
Expand Down
3 changes: 3 additions & 0 deletions src/Illuminate/Validation/Rules/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Contracts\Validation\ValidatorAwareRule;
use Illuminate\Support\Arr;
use Illuminate\Support\Traits\Conditionable;
use TypeError;

class Enum implements Rule, ValidatorAwareRule
{
use Conditionable;

/**
* The type of the enum.
*
Expand Down
17 changes: 17 additions & 0 deletions tests/Database/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3612,6 +3612,23 @@ public function testTruncateMethod()
], $sqlite->compileTruncate($builder));
}

public function testTruncateMethodWithPrefix()
{
$builder = $this->getBuilder();
$builder->getGrammar()->setTablePrefix('prefix_');
$builder->getConnection()->shouldReceive('statement')->once()->with('truncate table "prefix_users"', []);
$builder->from('users')->truncate();

$sqlite = new SQLiteGrammar;
$sqlite->setTablePrefix('prefix_');
$builder = $this->getBuilder();
$builder->from('users');
$this->assertEquals([
'delete from sqlite_sequence where name = ?' => ['prefix_users'],
'delete from "prefix_users"' => [],
], $sqlite->compileTruncate($builder));
}

public function testPreserveAddsClosureToArray()
{
$builder = $this->getBuilder();
Expand Down
1 change: 1 addition & 0 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function testStringApa()
$this->assertSame('To Kill a Mockingbird', Str::apa('To Kill A Mockingbird'));

$this->assertSame('', Str::apa(''));
$this->assertSame(' ', Str::apa(' '));
}

public function testStringWithoutWordsDoesntProduceError()
Expand Down

0 comments on commit 7de4d1e

Please sign in to comment.