diff --git a/.github/workflows/databases.yml b/.github/workflows/databases.yml index a42954e826bc..30cf783b35ea 100644 --- a/.github/workflows/databases.yml +++ b/.github/workflows/databases.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/facades.yml b/.github/workflows/facades.yml index 589c600a5306..e368de1c8876 100644 --- a/.github/workflows/facades.yml +++ b/.github/workflows/facades.yml @@ -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 diff --git a/.github/workflows/queues.yml b/.github/workflows/queues.yml index fd583e6c3f8f..ee56364cbf51 100644 --- a/.github/workflows/queues.yml +++ b/.github/workflows/queues.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index a96597ca96f9..2fc2f9d06ffb 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 093ad63b7954..340292c92fbc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/Illuminate/Cache/Console/PruneStaleTagsCommand.php b/src/Illuminate/Cache/Console/PruneStaleTagsCommand.php index 95665f9bab87..dbb2f6bd0860 100644 --- a/src/Illuminate/Cache/Console/PruneStaleTagsCommand.php +++ b/src/Illuminate/Cache/Console/PruneStaleTagsCommand.php @@ -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) { diff --git a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php index 04862e5d80f7..48444a52db85 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php @@ -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; @@ -154,6 +155,10 @@ protected function formatRecordsList(array $records) [$id, $attributes] = [$attributes, []]; } + if ($id instanceof BackedEnum) { + $id = $id->value; + } + return [$id => $attributes]; })->all(); } diff --git a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php index 0c43e4db8bfd..5a754ebdb852 100755 --- a/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php @@ -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) => [], ]; } diff --git a/src/Illuminate/Mail/resources/views/text/header.blade.php b/src/Illuminate/Mail/resources/views/text/header.blade.php index aaa3e5754446..97444ebdcfd1 100644 --- a/src/Illuminate/Mail/resources/views/text/header.blade.php +++ b/src/Illuminate/Mail/resources/views/text/header.blade.php @@ -1 +1 @@ -[{{ $slot }}]({{ $url }}) +{{ $slot }}: {{ $url }} diff --git a/src/Illuminate/Support/Facades/Facade.php b/src/Illuminate/Support/Facades/Facade.php index caba479ee65e..544512954990 100755 --- a/src/Illuminate/Support/Facades/Facade.php +++ b/src/Illuminate/Support/Facades/Facade.php @@ -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; @@ -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() { @@ -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) diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index 6df746e05553..39e303cae3b1 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -1309,7 +1309,7 @@ public static function headline($value) */ public static function apa($value) { - if ($value === '') { + if (trim($value) === '') { return $value; } @@ -1645,7 +1645,7 @@ public static function uuid() } /** - * Generate a time-ordered UUID (version 4). + * Generate a time-ordered UUID. * * @return \Ramsey\Uuid\UuidInterface */ diff --git a/src/Illuminate/Validation/Rules/Enum.php b/src/Illuminate/Validation/Rules/Enum.php index 42d9e6f012d2..62114626eca7 100644 --- a/src/Illuminate/Validation/Rules/Enum.php +++ b/src/Illuminate/Validation/Rules/Enum.php @@ -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. * diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 9ac232e78531..a3b98162d521 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -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(); diff --git a/tests/Support/SupportStrTest.php b/tests/Support/SupportStrTest.php index c7688e8cdba0..844c52b781bc 100755 --- a/tests/Support/SupportStrTest.php +++ b/tests/Support/SupportStrTest.php @@ -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()